diff --git a/app/crmAdmin/logic/CustomerLogic.php b/app/crmAdmin/logic/CustomerLogic.php index 8f364e8..869982f 100644 --- a/app/crmAdmin/logic/CustomerLogic.php +++ b/app/crmAdmin/logic/CustomerLogic.php @@ -18,7 +18,7 @@ class CustomerLogic public function forceDelete(int $id) { - $customer = Customer::find($id); + $customer = Customer::withTrashed()->find($id); //强制删除 $res = $customer->forceDelete(); return $res; diff --git a/app/crmAdmin/service/CustomerService.php b/app/crmAdmin/service/CustomerService.php index 520d335..d003a0b 100644 --- a/app/crmAdmin/service/CustomerService.php +++ b/app/crmAdmin/service/CustomerService.php @@ -128,7 +128,8 @@ class CustomerService } if ($scene == 'audit') { //审核时查询举报人姓名 $customerHis = CustomerHis::where('customer_id', $item->id)->orderBy('id', 'desc')->first(['user_his']); - $item['user_name'] = empty($customerHis['user_his']) ? '' : User::where('id',$customer['user_his'])->value('name'); + var_dump($customerHis['user_his']); + $item['user_name'] = empty($customerHis['user_his']) ? '' : User::where('id',$customerHis['user_his'])->value('name'); } } } @@ -276,10 +277,6 @@ class CustomerService $id = $params['id']; - $where = [ - 'id' => $id, - ]; - $logic = new CustomerLogic(); if ($params['scene'] == 'delete') { return $logic->forceDelete($params['id']);