diff --git a/admin/controllers/app/licheb/Member.php b/admin/controllers/app/licheb/Member.php index 5c167e60..ffb68451 100755 --- a/admin/controllers/app/licheb/Member.php +++ b/admin/controllers/app/licheb/Member.php @@ -74,21 +74,35 @@ class Member extends HD_Controller{ { $id = $this->input->get('id'); $row = $this->userM->get(['id'=>$id]); - $bizs = $this->biz_model->select(['status>='=>0],'id desc','','','id,biz_name'); - $this->data['bizs'] = $bizs; - $this->data['row'] = $row; + if($id){ + $info = array( + 'id' => $row['id'], + 'uname' => $row['uname'], + 'mobile' => $row['mobile'], + 'group_id' => $row['group_id'], + 'biz_id' => $row['biz_id'], + ); + $action = '/app/licheb/member/edit'; + $_title = '编辑用户'; + } else { + $info = array('biz_id' => '', 'group_id' => ''); + $action = '/app/licheb/member/add'; + $_title = '添加用户'; + } + $this->data['info'] = $info; $this->data['groups'] = $this->groups; - $this->data['_title'] = $row ? '编辑用户' : '添加用户'; + $this->data['action'] = $action; + $this->data['_title'] = $_title; return $this->show_view('app/licheb/member/get'); } //添加单条数据 public function add(){ - - $uname = $this->input->post('uname'); - $mobile = $this->input->post('mobile'); - $group_id = $this->input->post('group_id'); - $biz_id = $this->input->post('biz_id'); + $info = $this->input->post('info'); + $uname = $info['uname']; + $mobile = $info['mobile']; + $group_id = $info['group_id']; + $biz_id = $info['biz_id']; if (!mobile_valid($mobile)) { return $this->show_json(SYS_CODE_FAIL, '输入正确手机号'); @@ -112,18 +126,19 @@ class Member extends HD_Controller{ $biz_id && $add['biz_id'] = $biz_id; $id = $this->userM->add($add); - return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); + return $this->show_json(SYS_CODE_SUCCESS, '操作成功', '/app/licheb/member'); } //编辑单条数据 public function edit() { - $id = $this->input->post('id'); - $uname = $this->input->post('uname'); - $nickname = $this->input->post('nickname'); - $mobile = $this->input->post('mobile'); - $group_id = $this->input->post('group_id'); - $biz_id = $this->input->post('biz_id'); + $info = $this->input->post('info'); + $id = $info['id']; + $uname = $info['uname']; + $nickname = $info['nickname']; + $mobile = $info['mobile']; + $group_id = $info['group_id']; + $biz_id = $info['biz_id']; if (!mobile_valid($mobile)) { return $this->show_json(SYS_CODE_FAIL, '输入正确手机号'); @@ -138,8 +153,9 @@ class Member extends HD_Controller{ 'mobile' => $mobile, ); - $group_id && $upd['group_id'] = $group_id; - $biz_id && $upd['biz_id'] = $biz_id; + $upd['group_id'] = $group_id ? $group_id : 0; + $upd['biz_id'] = $biz_id ? $biz_id : 0; + $nickname && $upd['nickname'] = $nickname; $uname && $upd['uname'] = $uname; diff --git a/admin/controllers/biz/store/Store.php b/admin/controllers/biz/store/Store.php index 0d722aba..246deadd 100755 --- a/admin/controllers/biz/store/Store.php +++ b/admin/controllers/biz/store/Store.php @@ -854,6 +854,25 @@ class Store extends HD_Controller{ return $this->show_json(SYS_CODE_SUCCESS); } + /** + * 获取店铺信息 + * @return bool + */ + function json_get(){ + $id = $this->input->post('id'); + + $row = $this->biz_model->get(array('id' => $id)); + $info = array( + 'id' => $row['id'], + 'title' => $row['biz_name'], + 'city_id' => $row['city_id'], + 'county_id' => $row['county_id'], + ); + + $this->data = $info; + return $this->show_json(SYS_CODE_SUCCESS); + } + /** * 获取用户信息(不存在新增,可以修改名称) * @param $mobile diff --git a/admin/views/app/licheb/member/get.php b/admin/views/app/licheb/member/get.php index 6d620049..3a0b942b 100755 --- a/admin/views/app/licheb/member/get.php +++ b/admin/views/app/licheb/member/get.php @@ -1,41 +1,221 @@ -
+
- +
- +
- + +
-
- + + + +
+
+ +
+
+
-
+
diff --git a/admin/views/app/licheb/member/lists.php b/admin/views/app/licheb/member/lists.php index a8e0a96e..40a63f0f 100755 --- a/admin/views/app/licheb/member/lists.php +++ b/admin/views/app/licheb/member/lists.php @@ -156,7 +156,6 @@ that.bizAry = []; that.params.biz_id = ''; } - console.log(that.bizAry); } }, watch:{ diff --git a/www/admin/static/js/common/admin.js b/www/admin/static/js/common/admin.js index 04969f88..1c73a76e 100644 --- a/www/admin/static/js/common/admin.js +++ b/www/admin/static/js/common/admin.js @@ -826,6 +826,7 @@ $(function () { window.location.href = this.options[this.selectedIndex].getAttribute('data-url'); }); + /*! 选择框联动 */ $body.on('change','[data-toggle="next-select"]',function () { var refurl = $(this).data('refurl'); var next = $(this).data('next');