代码提交

This commit is contained in:
wong
2025-07-06 00:17:24 +08:00
parent e808ee1a90
commit 15b899b0e8
9 changed files with 606 additions and 230 deletions

View File

@@ -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], '添加计划任务成功');