diff --git a/app/common/repositories/store/service/StoreServiceRepository.php b/app/common/repositories/store/service/StoreServiceRepository.php index 6dd8d04..00e4d30 100644 --- a/app/common/repositories/store/service/StoreServiceRepository.php +++ b/app/common/repositories/store/service/StoreServiceRepository.php @@ -70,7 +70,7 @@ class StoreServiceRepository extends BaseRepository */ public function form($merId, $isUpdate = false) { - $pwd = Elm::password('pwd', '客服密码'); + $pwd = Elm::password('pwd', '员工密码'); $confirm_pwd = Elm::password('confirm_pwd', '确认密码'); if (!$isUpdate) { $pwd->required(); @@ -79,11 +79,13 @@ class StoreServiceRepository extends BaseRepository $adminRule = $filed = []; if($merId){ $adminRule = [ - Elm::switches('customer', '订单管理', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12), - Elm::switches('is_goods', '商品管理', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12), - Elm::switches('is_verify', '开启核销', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12), - Elm::switches('is_user', '用户管理', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12), - Elm::switches('notify', '订单通知', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->control([ + Elm::switches('status', '客服状态', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), + Elm::switches('customer', '订单管理', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), + Elm::switches('is_goods', '商品管理', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), + Elm::switches('is_verify', '开启核销', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), + Elm::switches('is_user', '客户管理', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), + Elm::switches('staff_manage', '员工管理', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), + Elm::switches('notify', '订单通知', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8)->control([ [ 'value' => 1, 'rule' => [ @@ -91,25 +93,25 @@ class StoreServiceRepository extends BaseRepository ] ] ]) + ]; } $filed = [ "value" => 1, "rule" => [ - "customer","is_goods","is_verify","notify","is_user" + "status","customer","is_goods","is_verify","notify","is_user","staff_manage" ] ]; $adminRule[] = Elm::number('sort', '排序', 0)->precision(0)->max(99999); $prefix = $merId ? config('admin.merchant_prefix') : config('admin.admin_prefix'); return Elm::createForm(Route::buildUrl('merchantServiceCreate')->build(), array_merge([ Elm::frameImage('uid', '用户', '/' . $prefix . '/setting/userList?field=uid&type=1')->prop('srcKey', 'src')->width('1000px')->height('600px')->appendValidate(Iview::validateObject()->message('请选择用户')->required())->modal(['modal' => false]), - Elm::frameImage('avatar', '客服头像', '/' . $prefix . '/setting/uploadPicture?field=avatar&type=1')->width('1000px')->height('600px')->props(['footer' => false])->modal(['modal' => false]), - Elm::input('nickname', '客服昵称')->required(), - Elm::input('account', '客服账号')->required(), + Elm::frameImage('avatar', '员工头像', '/' . $prefix . '/setting/uploadPicture?field=avatar&type=1')->width('1000px')->height('600px')->props(['footer' => false])->modal(['modal' => false]), + Elm::input('nickname', '员工昵称')->required(), + Elm::input('account', '员工账号')->required(), $pwd, $confirm_pwd, - Elm::switches('is_open', '账号状态', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12)->control([$filed]), - Elm::switches('status', '客服状态', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(12), - ], $adminRule))->setTitle('添加客服'); + Elm::switches('is_open', '账号状态', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8)->control([$filed]), + ], $adminRule))->setTitle('添加员工'); } /** diff --git a/app/controller/api/user/Exchange.php b/app/controller/api/user/Exchange.php index 37cc18f..4cd0da7 100644 --- a/app/controller/api/user/Exchange.php +++ b/app/controller/api/user/Exchange.php @@ -166,16 +166,25 @@ class Exchange extends BaseController{ * @return mixed */ public function getConsumeList(){ - $search = $this->request->params(['search_text', 'default_consume_id']); + $search = $this->request->params(['search_text', 'default_consume_id','search_id_and_phone']); $list = app()->make(UserRepository::class) ->getSearch([]) ->field(['uid','real_name','nickname','avatar','phone']) - ->where(function($query) use ($search){ - // 用户ID/用户昵称/真实姓名/联系电话 - $query->where('uid',$search['search_text']) - ->whereOr('nickname','like',"%{$search['search_text']}%") - ->whereOr('real_name','like',"%{$search['search_text']}%") - ->whereOr('phone','like',"%{$search['search_text']}%"); + ->when(!empty($search['search_text']),function($query) use ($search){ + $query->where(function($query) use ($search){ + // 用户ID/用户昵称/真实姓名/联系电话 + $query->where('uid',$search['search_text']) + ->whereOr('nickname','like',"%{$search['search_text']}%") + ->whereOr('real_name','like',"%{$search['search_text']}%") + ->whereOr('phone','like',"%{$search['search_text']}%"); + }); + }) + ->when(!empty($search['search_id_and_phone']),function($query) use ($search){ + $query->where(function($query) use ($search){ + // 用户ID/联系电话 + $query->where('uid',$search['search_id_and_phone']) + ->whereOr('phone',$search['search_id_and_phone']); + }); }) ->when(isset($search['default_consume_id']) && $search['default_consume_id'] > 0,function($query) use ($search){ $query->where('uid',$search['default_consume_id']);