diff --git a/app/crm/service/CustomerService.php b/app/crm/service/CustomerService.php index e781f68..4155de2 100644 --- a/app/crm/service/CustomerService.php +++ b/app/crm/service/CustomerService.php @@ -80,15 +80,18 @@ class CustomerService $query->whereIn('grade', $grade); } - if ($recycle == 'recycle' || $seas == 'seas') { + if ($recycle == 'recycle') { $query->onlyTrashed(); } + if ($seas == 'seas') { + $query->withTrashed()(); + } - $customer = Customer::where($where)->paginate($perPage, ['*'], 'page', $page); + $customer = $query->paginate($perPage, ['*'], 'page', $page); foreach ($customer as &$item) { $item = $this->getCustomer($item); if($seas == 'seas'){ - $item['seas_time'] = time()-(empty($item['deleted_at'])?0:strtotime($item['deleted_at'])); + $item['seas_time'] = time()-(empty($item['deleted_at'])?$item['updated_at']:strtotime($item['deleted_at'])); } } unset($item);