From 1f827846fba6e91aecc354fdc716e2cd421c7ee1 Mon Sep 17 00:00:00 2001 From: fengxinyhyl Date: Mon, 15 Apr 2024 09:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E4=BB=A3=E7=90=86=E6=B8=85?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/user/User.php | 13 ++++++++----- public/system.html | 2 +- view/admin/src/views/user/list/index.vue | 9 ++++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/controller/admin/user/User.php b/app/controller/admin/user/User.php index 632272a..cc46d06 100644 --- a/app/controller/admin/user/User.php +++ b/app/controller/admin/user/User.php @@ -466,12 +466,15 @@ class User extends BaseController if (!$this->repository->exists($id)) return app('json')->fail('数据不存在'); $where = array(); - $where[] = array('agent_district_id' , '=', $agent_district_id); - $where[] = array('uid' , '<>', $id); - $exist = $this->repository->getWhere($where); - if($exist){ - return app('json')->fail('该代理已存在'); + if($agent_district_id){ + $where[] = array('agent_district_id' , '=', $agent_district_id); + $where[] = array('uid' , '<>', $id); + $exist = $this->repository->getWhere($where); + if($exist){ + return app('json')->fail('该代理已存在'); + } } + $this->repository->update($id, array('agent_district_id' => $agent_district_id, 'agent_district' => $agent_district)); return \app('json')->success('修改成功'); } diff --git a/public/system.html b/public/system.html index 1594aa3..42d2fdf 100644 --- a/public/system.html +++ b/public/system.html @@ -1,3 +1,3 @@ -加载中...
\ No newline at end of file diff --git a/view/admin/src/views/user/list/index.vue b/view/admin/src/views/user/list/index.vue index 484ba83..fde0d86 100644 --- a/view/admin/src/views/user/list/index.vue +++ b/view/admin/src/views/user/list/index.vue @@ -481,11 +481,14 @@ export default { methods: { submitArea(){ if(!this.selectedValue){ - this.$message.warning('请选择区域'); - return; + var agent_district_id = 0; + var agent_district = ''; + }else{ + var agent_district_id = this.selectedValue[this.selectedValue.length-1]; + var agent_district = this.regionText; } - setAreaApi(this.selectedUser.uid,{agent_district_id:this.selectedValue[this.selectedValue.length-1],agent_district:this.regionText}).then((res) => { + setAreaApi(this.selectedUser.uid,{agent_district_id:agent_district_id,agent_district:agent_district}).then((res) => { this.getList('') this.areaDialogVisible = false; }).catch(({ message }) => {