From d79a768eb19ae62e0b90795ad0bfd86fe42b1a03 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 19 Jan 2024 10:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=95=86=E6=88=B7?= =?UTF-8?q?=20-=20=E5=91=98=E5=B7=A5=E7=BC=96=E8=BE=91=20-=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=91=98=E5=B7=A5=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86=E3=80=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=9A=E9=85=92=E5=8D=A1=E9=A2=9D=E5=BA=A6=E8=BD=AC?= =?UTF-8?q?=E8=B5=A0=20-=20=E6=8E=A5=E6=94=B6=E7=94=A8=E6=88=B7=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E4=BC=98=E5=8C=96=EF=BC=8C=E5=8F=96=E6=B6=88=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=E6=90=9C=E7=B4=A2=EF=BC=8C=E6=8C=87=E5=AE=9A=E6=90=9C?= =?UTF-8?q?=E7=B4=A2id=E6=88=96=E8=80=85=E6=89=8B=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/service/StoreServiceRepository.php | 28 ++++++++++--------- app/controller/api/user/Exchange.php | 23 ++++++++++----- 2 files changed, 31 insertions(+), 20 deletions(-) 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']);