客户下拉
This commit is contained in:
@@ -164,6 +164,39 @@ class CustomerService
|
||||
return $customer;
|
||||
}
|
||||
|
||||
public function preset($params)
|
||||
{
|
||||
$keyword = $params['keyword'] ?? '';
|
||||
$where = [];
|
||||
$user_id =$params['user_id'];
|
||||
|
||||
$where[] = ['status', 1];
|
||||
$where[] = ['user_id', $user_id];
|
||||
|
||||
if (!empty($countryId)){
|
||||
$where[] = ['country_id', $countryId];
|
||||
}
|
||||
|
||||
$query = Customer::select('id','code','sn','corp_id','email','phone','WhatsApp','contacts','company')->where($where);
|
||||
|
||||
if (!Util::isEmpty($keyword)) {
|
||||
$query->where(function ($query) use ($keyword) {
|
||||
$query->where('contacts', 'like', "%{$keyword}%")
|
||||
->orWhere('phone', 'like', "%{$keyword}%")
|
||||
->orWhere('email', 'like', "%{$keyword}%")
|
||||
->orWhere('WhatsApp', 'like', "%{$keyword}%")
|
||||
->orWhere('code', 'like', "%{$keyword}%");
|
||||
});
|
||||
}
|
||||
$customer = $query->orderBy('follow_last','desc')->get();
|
||||
|
||||
foreach ($customer as &$item) {
|
||||
}
|
||||
unset($item);
|
||||
|
||||
return $customer;
|
||||
}
|
||||
|
||||
|
||||
/** 分页列表 */
|
||||
public function serviceList(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user