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