Merge branch 'feature/delete' into develop
This commit is contained in:
@@ -147,15 +147,18 @@ class CustomerController extends BaseController
|
|||||||
return $this->error('customer_id'.trans('not_null'));
|
return $this->error('customer_id'.trans('not_null'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$where = [
|
$customer_id = explode(',', $param['customer_id']);
|
||||||
'id' => $param['customer_id'],
|
$customer = Customer::whereIn('id',$customer_id)->withTrashed()->first();
|
||||||
];
|
|
||||||
$customer = Customer::where($where)->withTrashed()->first();
|
|
||||||
if(empty($customer)){
|
if(empty($customer)){
|
||||||
return $this->error( trans('fail'));
|
return $this->error( trans('fail'));
|
||||||
}
|
}
|
||||||
//软删除
|
if($param['scene'] == 'list'){ //管理端客户列表移除
|
||||||
$customer->status = 3;
|
$customer->status = 4;
|
||||||
|
|
||||||
|
}else{ //公海软删除
|
||||||
|
$customer->status = 3;
|
||||||
|
|
||||||
|
}
|
||||||
$res = $customer->save();
|
$res = $customer->save();
|
||||||
$customer->delete();
|
$customer->delete();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user