From e966dd36c24eb2822fe9ac4180e1832f65caaeb0 Mon Sep 17 00:00:00 2001 From: qianhy Date: Mon, 6 Mar 2023 16:03:37 +0800 Subject: [PATCH] brand status about select 0306 --- admin/controllers/Common.php | 10 +++++++++- admin/controllers/auto/Business.php | 5 +++-- admin/controllers/auto/Finance.php | 1 + admin/controllers/auto/Introduce.php | 3 ++- admin/controllers/auto/Series.php | 3 ++- admin/controllers/items/goods/Goods.php | 7 ++++++- admin/views/auto/attr/edit.php | 2 +- admin/views/auto/finance/get.php | 2 +- admin/views/auto/introduce/edit.php | 1 - admin/views/items/goods/lists_sold.php | 4 ++-- 10 files changed, 27 insertions(+), 11 deletions(-) diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php index 1fd31a8c..90992596 100644 --- a/admin/controllers/Common.php +++ b/admin/controllers/Common.php @@ -1488,7 +1488,15 @@ class Common extends CI_Controller } if ($type == 1) { $tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择品牌'); - $res = $this->mdAutoBrand->select($where, 'id desc', 0, 0, 'id,name'); + #$res = $this->mdAutoBrand->select($where, 'id desc', 0, 0, 'id,name'); + $res = array(); + $rows = $this->mdAutoBrand->select($where, 'status desc, id asc', 0, 0, 'id,name'); + foreach($rows as $v){ + $res[] = array( + 'id' => strlen($status) > 0 ? $v['id'] : " " . $v['id'], + 'name' => $v['name'], + ); + } } else if ($type == 2) { $tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车系'); $res = $this->mdAutoSeries->select(array_merge($where, ['brand_id' => $pid]), 'id desc', 0, 0, 'id,name'); diff --git a/admin/controllers/auto/Business.php b/admin/controllers/auto/Business.php index 8135b190..08f49790 100644 --- a/admin/controllers/auto/Business.php +++ b/admin/controllers/auto/Business.php @@ -152,14 +152,15 @@ class Business extends HD_Controller{ public function get() { $id = $this->input->get('id'); - $map_brand = $this->auto_brand_model->map('id', 'name', ['status>'=>-1], 'id desc', 0 , 0, 'id, name'); + #$map_brand = $this->auto_brand_model->map('id', 'name', ['status>'=>-1], 'id desc', 0 , 0, 'id, name'); + $map_brand = $this->auto_brand_model->map_brand_list($this->auto_brand_model->map_brand(array('status = 1' => null))); $city_rows = $this->sys_city_model->select(['status'=>1],'id desc',0,0,'city_id,name'); $row = $this->auto_business_model->get(['id'=>$id]); if($id && $row){ $info = [ 'id' => $row['id'], 'city_id' => $row['city_id'], - 'brand_id' => $row['brand_id'], + 'brand_id' => ' '.$row['brand_id'], 's_id' => $row['s_id'], 'v_id' => $row['v_id'], 'price_car' => $row['price_car'], diff --git a/admin/controllers/auto/Finance.php b/admin/controllers/auto/Finance.php index c7f612c8..6b6788cc 100644 --- a/admin/controllers/auto/Finance.php +++ b/admin/controllers/auto/Finance.php @@ -44,6 +44,7 @@ class Finance extends HD_Controller{ $params['s_id'] && $where["$t2.s_id"] = $params['s_id']; $params['v_id'] && $where["$t2.v_id"] = $params['v_id']; $params['cor_id'] && $where["$t2.cor_id"] = $params['cor_id']; + $where[$t2.'.brand_id in (select id from lc_auto_brand where status = 1)'] = null; $total = $this->auto_finance_model->count_finance($where); $lists = array(); diff --git a/admin/controllers/auto/Introduce.php b/admin/controllers/auto/Introduce.php index be7e3878..1a39f0fc 100644 --- a/admin/controllers/auto/Introduce.php +++ b/admin/controllers/auto/Introduce.php @@ -152,7 +152,8 @@ class Introduce extends HD_Controller ); $showInfo = ['title' => '请选择车型', 'url' => '/auto/introduce/add']; } - $showInfo['brandList'] = $this->mdAutoBrand->select(["status<>-1" => null], 'id desc', 0, 0, 'id, name'); + #$showInfo['brandList'] = $this->mdAutoBrand->select(["status<>-1" => null], 'id desc', 0, 0, 'id, name'); + $showInfo['brandList'] = $this->mdAutoBrand->map_brand_list($this->mdAutoBrand->map_brand(array('status > -1' => null), false)); $this->data['_title'] = $_title; $this->data['info'] = $info; $this->data['showInfo'] = $showInfo; diff --git a/admin/controllers/auto/Series.php b/admin/controllers/auto/Series.php index 44dfa717..d747d3a6 100644 --- a/admin/controllers/auto/Series.php +++ b/admin/controllers/auto/Series.php @@ -117,7 +117,8 @@ class Series extends HD_Controller{ return $this->show_json(SYS_CODE_FAIL, '数据不存在!'); } } - $brands = $this->auto_brand_model->select([],'','','','id,name'); + #$brands = $this->auto_brand_model->select([],'','','','id,name'); + $brands = $this->auto_brand_model->map_brand_list($this->auto_brand_model->map_brand(array('status > -1' => null), false)); $this->data['brands'] = $brands; $this->data['info'] = $info; $this->data['_title'] = $id ? '编辑车系' : '新增车系'; diff --git a/admin/controllers/items/goods/Goods.php b/admin/controllers/items/goods/Goods.php index 52578667..ce4708e2 100644 --- a/admin/controllers/items/goods/Goods.php +++ b/admin/controllers/items/goods/Goods.php @@ -470,9 +470,14 @@ class Goods extends HD_Controller $info['in_time'] = date('Y-m-d H:i:s'); $_title = '新增商品'; $edit_url = '/items/goods/goods/add'; + $where_auto = ['status>' => -1]; + } + + if ($this->input->get('sold') != 1){ $where_auto = ['status' => 1]; } - $autoList[1] = $this->mdAutoBrand->select($where_auto, 'id desc', 0, 0, 'id,name'); + #$autoList[1] = $this->mdAutoBrand->select($where_auto, 'id desc', 0, 0, 'id,name'); + $autoList[1] = $this->mdAutoBrand->map_brand($where_auto, false); $showInfo['autoList'] = $autoList; $showInfo['comList'] = $comList; $showInfo['statusAry'] = $this->statusAry; diff --git a/admin/views/auto/attr/edit.php b/admin/views/auto/attr/edit.php index 85effd1e..77b67023 100755 --- a/admin/views/auto/attr/edit.php +++ b/admin/views/auto/attr/edit.php @@ -87,7 +87,7 @@ url: '/auto/brand/json_lists', type: 'post', dataType: 'json', - data: {status:1}, + data: {status:'>-1'}, beforeSend: function () {}, success: function (data) { if (1 == data.code) { diff --git a/admin/views/auto/finance/get.php b/admin/views/auto/finance/get.php index 2576331d..cb363b4c 100644 --- a/admin/views/auto/finance/get.php +++ b/admin/views/auto/finance/get.php @@ -108,7 +108,7 @@ methods:{ init_auto:function(){ var vm = this; - $.get('common/auto',{type:1,tp:1},function(response){ + $.get('common/auto',{type:1,tp:1,status:3},function(response){ if (response.code == 1) { vm.brand_arr = response.data; } diff --git a/admin/views/auto/introduce/edit.php b/admin/views/auto/introduce/edit.php index d81a8018..26f4899e 100644 --- a/admin/views/auto/introduce/edit.php +++ b/admin/views/auto/introduce/edit.php @@ -66,7 +66,6 @@ - diff --git a/admin/views/items/goods/lists_sold.php b/admin/views/items/goods/lists_sold.php index 49e29f0a..10677fb6 100644 --- a/admin/views/items/goods/lists_sold.php +++ b/admin/views/items/goods/lists_sold.php @@ -253,7 +253,7 @@
-
@@ -342,7 +342,7 @@ :data-open="'/items/goods/logs/get?id='+v.id+'&title='+v.title" class="am-btn am-btn-primary am-btn-xs">轨迹 编辑