代码提交
This commit is contained in:
@@ -121,6 +121,7 @@ class PostCreateAddFriendPlanV1Controller extends Controller
|
||||
|
||||
|
||||
try {
|
||||
Db::startTrans();
|
||||
// 插入数据
|
||||
$planId = Db::name('customer_acquisition_task')->insertGetId($data);
|
||||
|
||||
@@ -220,7 +221,7 @@ class PostCreateAddFriendPlanV1Controller extends Controller
|
||||
$existingPhones = [];
|
||||
if (!empty($phones)) {
|
||||
$existing = Db::name('task_customer')
|
||||
->where('task_id', $params['planId'])
|
||||
->where('task_id', $planId)
|
||||
->where('phone', 'in', $phones)
|
||||
->field('phone')
|
||||
->select();
|
||||
@@ -233,7 +234,7 @@ class PostCreateAddFriendPlanV1Controller extends Controller
|
||||
$phone = !empty($row['phone']) ? $row['phone'] : $row['wechat'];
|
||||
if (!empty($phone) && !in_array($phone, $existingPhones)) {
|
||||
$newData[] = [
|
||||
'task_id' => $params['planId'],
|
||||
'task_id' => $planId,
|
||||
'name' => $row['name'] ?? '',
|
||||
'source' => $row['source'] ?? '',
|
||||
'phone' => $phone,
|
||||
@@ -254,6 +255,7 @@ class PostCreateAddFriendPlanV1Controller extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
|
||||
return ResponseHelper::success(['planId' => $planId], '添加计划任务成功');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user