Merge branch 'feature/crm0808' into develop_bm
This commit is contained in:
@@ -54,6 +54,9 @@ class UserService
|
||||
$k = '%' . $p['keyword'] . '%';
|
||||
$config['where']['name'] = ['like', $k];
|
||||
}
|
||||
if (isset($p['user_id']) && $p['user_id']) {
|
||||
$config['where']['user_id'] = $p['user_id'];
|
||||
}
|
||||
if (isset($p['id']) && $p['id']) {
|
||||
$config['where']['id'] = $p['id'];
|
||||
}
|
||||
|
||||
@@ -536,37 +536,14 @@ class CustomerController extends BaseController
|
||||
public function cede(Request $request)
|
||||
{
|
||||
$customerId = Util::getParam($request, 'customer_id');
|
||||
$user_sn = Util::getParam($request, 'user_sn');
|
||||
$userId = $request->user->uid;
|
||||
if (Util::isEmpty($user_sn)) {
|
||||
return $this->error('ID'.trans('not_null'));
|
||||
}
|
||||
$userId = Util::getParam($request, 'user_id');
|
||||
|
||||
$user = User::where(['sn' => $user_sn])->first();
|
||||
$user = User::where(['id' => $userId])->first();
|
||||
if (Util::isEmpty($user)) {
|
||||
return $this->error( trans('user_none'));
|
||||
}
|
||||
|
||||
if(Util::isEmpty($customerId)){
|
||||
$data = [
|
||||
'user_id' => $userId
|
||||
];
|
||||
$query= Customer::where($data);
|
||||
}else{
|
||||
$query= Customer::whereIn('id',explode(',',$customerId));
|
||||
}
|
||||
// $customer = $query->get();
|
||||
//
|
||||
// foreach ($customer as $item) {
|
||||
// //记录客户关系变化
|
||||
// $his = CustomerHis::create([
|
||||
// 'customer_id' => $item->id,
|
||||
// 'user_his' => $item->user_id,
|
||||
// 'user_id' => $user['id'],
|
||||
// ]);
|
||||
// }
|
||||
// $res = $query->update(['user_id' => $user->id]);
|
||||
|
||||
$query= Customer::whereIn('id',explode(',',$customerId));
|
||||
try {
|
||||
$customer = $query->get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user