|
@@ -489,13 +489,20 @@ class CustomService
|
|
if (!is_array($ids)) {
|
|
if (!is_array($ids)) {
|
|
$ids = [$ids];
|
|
$ids = [$ids];
|
|
}
|
|
}
|
|
|
|
+ Db::beginTransaction();
|
|
try {
|
|
try {
|
|
if (is_array($ids)) {
|
|
if (is_array($ids)) {
|
|
MarketCustomer::whereIn('id', $ids)->delete();
|
|
MarketCustomer::whereIn('id', $ids)->delete();
|
|
|
|
+ MarketCustomerFollow::whereIn('market_customer_id', $ids)->delete();//删除跟进记录
|
|
|
|
+ MarketCustomerLogs::whereIn('market_customer_id', $ids)->delete();//删除移交记录
|
|
} else {
|
|
} else {
|
|
MarketCustomer::where('id', $ids)->delete();
|
|
MarketCustomer::where('id', $ids)->delete();
|
|
|
|
+ MarketCustomerFollow::where('market_customer_id', $ids)->delete();//删除跟进记录
|
|
|
|
+ MarketCustomerLogs::where('market_customer_id', $ids)->delete();//删除移交记录
|
|
}
|
|
}
|
|
|
|
+ Db::commit();
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
|
|
+ Db::rollBack();
|
|
return json_fail('删除失败');
|
|
return json_fail('删除失败');
|
|
}
|
|
}
|
|
|
|
|