添加好友优化
This commit is contained in:
@@ -153,9 +153,10 @@ class Adapter implements WeChatServiceInterface
|
||||
|
||||
public function handleCustomerTaskWithStatusIsNew(int $current_worker_id, int $process_count_for_status_0)
|
||||
{
|
||||
|
||||
$task = Db::name('customer_acquisition_task')
|
||||
->where(['status' => 1,'deleteTime' => 0])
|
||||
->whereRaw("id % $process_count_for_status_0 = {$current_worker_id}")
|
||||
->order('id desc')
|
||||
->select();
|
||||
|
||||
if (empty($task)) {
|
||||
@@ -164,11 +165,16 @@ class Adapter implements WeChatServiceInterface
|
||||
|
||||
$taskData = [];
|
||||
foreach ($task as $item) {
|
||||
$reqConf = json_decode($item['reqConf'], true);
|
||||
$device = $reqConf['device'] ?? [];
|
||||
$deviceCount = count($device);
|
||||
if ($deviceCount <= 0){
|
||||
continue;
|
||||
}
|
||||
$tasks = Db::name('task_customer')
|
||||
->where(['status'=> 0,'task_id'=>$item['id']])
|
||||
->whereRaw("id % $process_count_for_status_0 = {$current_worker_id}")
|
||||
->order('id DESC')
|
||||
->limit(5)
|
||||
->limit($deviceCount)
|
||||
->select();
|
||||
$taskData = array_merge($taskData, $tasks);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user