Browse Source

批量打标签调试

shensong00 16 hours ago
parent
commit
5697c1aa17
2 changed files with 16 additions and 2 deletions
  1. 15 1
      app/Console/Commands/Test.php
  2. 1 1
      app/Models/Tencent/TxClickRecord.php

+ 15 - 1
app/Console/Commands/Test.php

7
 use App\Models\AdqPlayletTrendData;
7
 use App\Models\AdqPlayletTrendData;
8
 use App\Models\AdqUser;
8
 use App\Models\AdqUser;
9
 use App\Models\AuthorizeCorp;
9
 use App\Models\AuthorizeCorp;
10
+use App\Models\BatchMarkTagRecord;
10
 use App\Models\BlackListRecord;
11
 use App\Models\BlackListRecord;
11
 use App\Models\ChatGroupMassMsg;
12
 use App\Models\ChatGroupMassMsg;
12
 use App\Models\ChatGroupMassMsgLog;
13
 use App\Models\ChatGroupMassMsgLog;
105
 //           $this->sysCorpCustomerListTest();
106
 //           $this->sysCorpCustomerListTest();
106
 
107
 
107
 //           $this->quitStaffRelationDel();
108
 //           $this->quitStaffRelationDel();
108
-           $this->ECommerceUserActionsDataUpload();
109
+//           $this->ECommerceUserActionsDataUpload();
109
 //           $this->delRelationData();
110
 //           $this->delRelationData();
110
 //           $this->updateDataRecord();
111
 //           $this->updateDataRecord();
112
+           $this->batchMarkTag();
111
 //           // 获取所有已激活客服列表
113
 //           // 获取所有已激活客服列表
112
 //           $followUserList = DjUser::getUserIdList($corpid);
114
 //           $followUserList = DjUser::getUserIdList($corpid);
113
 //           $followUserList = json_decode(json_encode($followUserList), 1);
115
 //           $followUserList = json_decode(json_encode($followUserList), 1);
127
        }
129
        }
128
     }
130
     }
129
 
131
 
132
+    public function batchMarkTag() {
133
+        $list = BatchMarkTagRecord::query()->where('exec_fail', '>', 0)->get();
134
+        foreach ($list as $info) {
135
+            $this->info('record_id : '.$info->id);
136
+            RedisModel::lPush(BatchMarkTagRecord::BATCH_MARK_TAG_RECORD, json_encode([
137
+                'task_id' => $info->task_id, 'record_id' => $info->id
138
+            ]));
139
+
140
+            sleep(1);
141
+        }
142
+    }
143
+
130
     public function ECommerceUserActionsDataUpload() {
144
     public function ECommerceUserActionsDataUpload() {
131
         $orderList = YxOrder::query()->where('order_create_time', '>=', '2024-11-27')->whereNull('ad_report_click_id')->where('order_status', 1)->get();
145
         $orderList = YxOrder::query()->where('order_create_time', '>=', '2024-11-27')->whereNull('ad_report_click_id')->where('order_status', 1)->get();
132
         foreach($orderList as $orderInfo) {
146
         foreach($orderList as $orderInfo) {

+ 1 - 1
app/Models/Tencent/TxClickRecord.php

20
     public static function getClickDataByAccount($accountId, $orderPayTime) {
20
     public static function getClickDataByAccount($accountId, $orderPayTime) {
21
         // 查询出来后立马修改状态,防止其他数据使用相同的数据
21
         // 查询出来后立马修改状态,防止其他数据使用相同的数据
22
         \DB::begintransaction();
22
         \DB::begintransaction();
23
-        $res1 = self::query()->where('account_id', $accountId)->where('enable', 1)
23
+        $res1 = self::query()->where('account_id', strval($accountId))->where('enable', 1)
24
             ->where('status', 0)->where('wechat_openid', '>', '')
24
             ->where('status', 0)->where('wechat_openid', '>', '')
25
             ->where('click_time', '<', $orderPayTime)->orderBy('id', 'desc')->first();
25
             ->where('click_time', '<', $orderPayTime)->orderBy('id', 'desc')->first();
26
         $res2 = false;
26
         $res2 = false;