Browse Source

客户批量打标签 调试

shensong00 1 month ago
parent
commit
08858ac187
1 changed files with 5 additions and 4 deletions
  1. 5 4
      app/Console/Commands/CorpInformation/BatchMarkTagNew.php

+ 5 - 4
app/Console/Commands/CorpInformation/BatchMarkTagNew.php

216
                         ->offset(($page - 1) * $limit)->limit($limit)->get();
216
                         ->offset(($page - 1) * $limit)->limit($limit)->get();
217
                     Log::logInfo('初始客户列表', ['user_id' => $userId, 'customer_list' => $customerList->toArray()], $this->logName);
217
                     Log::logInfo('初始客户列表', ['user_id' => $userId, 'customer_list' => $customerList->toArray()], $this->logName);
218
 
218
 
219
-                    $userFilterCustomerList = $newFilterCustomerList[$userId]['list'] ?? [];
219
+                    $userFilterCustomerList = $newFilterCustomerList[$userId]['list'][0] ?? [];
220
                     Log::logInfo('待过滤客户列表', ['user_id' => $userId, 'customer_list' => $userFilterCustomerList], $this->logName);
220
                     Log::logInfo('待过滤客户列表', ['user_id' => $userId, 'customer_list' => $userFilterCustomerList], $this->logName);
221
                     if (!empty($userFilterCustomerList)) {
221
                     if (!empty($userFilterCustomerList)) {
222
-                        $newCustomerList = $this->filterCustomerList($customerList->toArray(), $userFilterCustomerList);
222
+//                        $newCustomerList = $this->filterCustomerList($customerList->toArray(), $userFilterCustomerList);
223
+                        $newCustomerList = $customerList->whereNotIn('customer_id', $userFilterCustomerList)->all();
223
                     } else {
224
                     } else {
224
-                        $newCustomerList = $customerList->toArray();
225
+                        $newCustomerList = $customerList->all();
225
                     }
226
                     }
226
-                    Log::logInfo('过滤后客户列表', [$newCustomerList], $this->logName);
227
+                    Log::logInfo('过滤后客户列表', ['user_id' => $userId, 'customer_list' => json_decode(json_encode($newCustomerList),1)], $this->logName);
227
 
228
 
228
 //                $userExternalUserIdList = array_column($newCustomerList, 'external_userid');
229
 //                $userExternalUserIdList = array_column($newCustomerList, 'external_userid');
229
 //                $externalUserIdArr = array_chunk($userExternalUserIdList, $this->limit);
230
 //                $externalUserIdArr = array_chunk($userExternalUserIdList, $this->limit);