diff --git a/admin/controllers/biz/brand/Brand.php b/admin/controllers/biz/brand/Brand.php index f5d99fef..07c8ccab 100755 --- a/admin/controllers/biz/brand/Brand.php +++ b/admin/controllers/biz/brand/Brand.php @@ -32,10 +32,6 @@ class Brand extends HD_Controller $this->data['brand_name'] && $where["brand_name like '%" . $this->data['brand_name'] . "%'"] = null; $count = $this->bizBrand->count($where); $list = $this->bizBrand->select($where, 'id desc', $page, $pagesize); - $typeAry = $this->bizBrand->type_ary();//类型 - foreach($list as &$brand){ - $brand['type_name'] = $typeAry[$brand['type']]; - } $this->data['lists'] = $list; $this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count); $this->data['_title'] = '品牌列表'; @@ -47,7 +43,6 @@ class Brand extends HD_Controller { $id = $this->input->get('id'); - $this->load->model("sys/sys_company_model", 'company_model'); if ($id) { $info = $this->bizBrand->get(array('id' => $id)); @@ -56,20 +51,12 @@ class Brand extends HD_Controller } $action = '/biz/brand/brand/edit'; } else { - $info = array('type' => 0, 'company_id' => 0); + $info = array(); $action = '/biz/brand/brand/add'; } - //获取公司ID列表 - $where = array('status' => 1); - $orderby = 'id desc'; - $select = 'id, short'; - $map_company = $this->company_model->map('id', 'short', $where, $orderby, 0, 0, $select); - $this->data['info'] = $info; $this->data['action'] = $action; - $this->data['typeAry'] = $this->bizBrand->type_ary(); - $this->data['companyAry'] = $map_company; $this->data['_title'] = $id ? '编辑品牌' : '新增品牌'; return $this->show_view('biz/brand/edit'); } @@ -111,8 +98,6 @@ class Brand extends HD_Controller $add_brand_data = array( 'brand_name' => $brand_name, 'brand_logo' => $img, - 'type' => intval($type), - 'company_id' => intval($info['company_id']), 'c_time' => time() ); $brand_id = $this->bizBrand->add($add_brand_data); @@ -149,8 +134,6 @@ class Brand extends HD_Controller $add_brand_data = array( 'brand_name' => $brand_name, 'brand_logo' => $img, - 'type' => intval($type), - 'company_id' => intval($info['company_id']), ); $this->bizBrand->update($add_brand_data, array('id' => $id)); return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); diff --git a/admin/controllers/biz/store/Store.php b/admin/controllers/biz/store/Store.php index c1fa8129..bb3647a1 100755 --- a/admin/controllers/biz/store/Store.php +++ b/admin/controllers/biz/store/Store.php @@ -158,10 +158,19 @@ class Store extends HD_Controller ); } $this->data['citys'] = $rows_city; - $biz = array('province_id' => '350');//默认福建城市 + $biz = array('province_id' => '350', 'type' => 0, 'company_id' => 0);//默认福建城市 $this->data['biz'] = $biz; } + //获取公司ID列表 + $this->load->model("sys/sys_company_model", 'company_model'); + $where = array('status' => 1); + $orderby = 'id desc'; + $select = 'id, short'; + $map_company = $this->company_model->map('id', 'short', $where, $orderby, 0, 0, $select); + + $this->data['typeAry'] = $this->biz_model->type_ary(); + $this->data['companyAry'] = $map_company; $this->data['_title'] = $id ? '编辑门店' : '新增门店'; $this->show_view('biz/store/edit', true); } @@ -190,6 +199,8 @@ class Store extends HD_Controller $biz['address'] = $this->input->post('address', true); $biz['lat'] = $this->input->post('lat', true); $biz['lng'] = $this->input->post('lng', true); + $biz['type'] = intval($this->input->post('type', true)); + $biz['company_id'] = intval($this->input->post('company_id', true)); //上传头像 $biz['headimg'] = $this->input->post('headimg'); @@ -248,6 +259,8 @@ class Store extends HD_Controller $biz['address'] = $this->input->post('address', true); $biz['lat'] = $this->input->post('lat', true); $biz['lng'] = $this->input->post('lng', true); + $biz['type'] = intval($this->input->post('type', true)); + $biz['company_id'] = intval($this->input->post('company_id', true)); //上传头像 $biz['headimg'] = $this->input->post('headimg'); diff --git a/admin/views/biz/brand/edit.php b/admin/views/biz/brand/edit.php index 6a56c115..bedfb2bd 100755 --- a/admin/views/biz/brand/edit.php +++ b/admin/views/biz/brand/edit.php @@ -22,24 +22,6 @@ -
- -
- -
-
-
- -
- -
-
@@ -54,15 +36,12 @@ el: '#vue-edit', data: { info:{}, - action:'', - typeAry:[] + action:'' }, mounted:function(){ var vm = this; vm.info = ; vm.action = ''; - vm.typeAry = ; - vm.companyAry = ; }, methods:{ saveEdit:function(){ diff --git a/admin/views/biz/brand/lists.php b/admin/views/biz/brand/lists.php index 4f03e369..03bbd06f 100755 --- a/admin/views/biz/brand/lists.php +++ b/admin/views/biz/brand/lists.php @@ -23,8 +23,7 @@ ID - 品牌名称 - 类型 + 品牌名称 操作 @@ -33,7 +32,6 @@ - | diff --git a/admin/views/biz/store/edit.php b/admin/views/biz/store/edit.php index 7d592cdb..0e8659c3 100755 --- a/admin/views/biz/store/edit.php +++ b/admin/views/biz/store/edit.php @@ -264,6 +264,24 @@
+
+ +
+ +
+
+
+ +
+ +
+