Browse Source

批量打标签调试

shensong00 14 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,6 +7,7 @@ use App\Log;
7 7
 use App\Models\AdqPlayletTrendData;
8 8
 use App\Models\AdqUser;
9 9
 use App\Models\AuthorizeCorp;
10
+use App\Models\BatchMarkTagRecord;
10 11
 use App\Models\BlackListRecord;
11 12
 use App\Models\ChatGroupMassMsg;
12 13
 use App\Models\ChatGroupMassMsgLog;
@@ -105,9 +106,10 @@ class Test extends Command
105 106
 //           $this->sysCorpCustomerListTest();
106 107
 
107 108
 //           $this->quitStaffRelationDel();
108
-           $this->ECommerceUserActionsDataUpload();
109
+//           $this->ECommerceUserActionsDataUpload();
109 110
 //           $this->delRelationData();
110 111
 //           $this->updateDataRecord();
112
+           $this->batchMarkTag();
111 113
 //           // 获取所有已激活客服列表
112 114
 //           $followUserList = DjUser::getUserIdList($corpid);
113 115
 //           $followUserList = json_decode(json_encode($followUserList), 1);
@@ -127,6 +129,18 @@ class Test extends Command
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 144
     public function ECommerceUserActionsDataUpload() {
131 145
         $orderList = YxOrder::query()->where('order_create_time', '>=', '2024-11-27')->whereNull('ad_report_click_id')->where('order_status', 1)->get();
132 146
         foreach($orderList as $orderInfo) {

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

@@ -20,7 +20,7 @@ class TxClickRecord extends Model
20 20
     public static function getClickDataByAccount($accountId, $orderPayTime) {
21 21
         // 查询出来后立马修改状态,防止其他数据使用相同的数据
22 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 24
             ->where('status', 0)->where('wechat_openid', '>', '')
25 25
             ->where('click_time', '<', $orderPayTime)->orderBy('id', 'desc')->first();
26 26
         $res2 = false;