brand status about series select, attr select

This commit is contained in:
qianhy
2023-03-07 17:16:37 +08:00
committed by lccsw
parent 6f2c182e79
commit aba90a66f8
15 changed files with 76 additions and 26 deletions
+15 -1
View File
@@ -216,10 +216,24 @@ class Attr extends HD_Controller
$where = array();
$s_id && $where['s_id'] = $s_id;
strlen($type) > 0 && $where['type'] = $type;
if ($status == 3) {//搜索专用
/*if ($status == 3) {//搜索专用
$where['status'] = 1;
} else {
$where['status>'] = -1;
}*/
if(strlen($status) > 0){
if (strpos($status,'>') !== false || strpos($status,'<') !== false || strpos($status,'in') !== false){
$where["status {$status}"] = null;
}
else{
if ($status == 3) {//搜索专用
$where['status'] = 1;
} else {
$where['status>'] = -1;
}
}
} else {
$where['status > -1'] = null;
}
$where['status>-1'] = null;
$total = $this->auto_attr_model->count($where);
+2
View File
@@ -26,6 +26,8 @@ class Business extends HD_Controller{
$where = array();
$where['brand_id in (select id from lc_auto_brand where status = 1)'] = null;
$where['s_id in (select id from lc_auto_series where status = 1)'] = null;
$where['v_id in (select id from lc_auto_attr where status = 1 and type = 1)'] = null;
if($params['brand_id']){
$where['brand_id'] = $params['brand_id'];
} else{
+4 -1
View File
@@ -30,6 +30,8 @@ class Cars extends HD_Controller{
$where = array();
$where['brand_id in (select id from lc_auto_brand where status > -1)'] = null;
$where['s_id in (select id from lc_auto_series where status > -1)'] = null;
$where['v_id in (select id from lc_auto_attr where status > -1 and type = 1)'] = null;
if($params['brand_id']){
$where['brand_id'] = $params['brand_id'];
} else{
@@ -121,7 +123,8 @@ class Cars extends HD_Controller{
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
#$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
$map_brand = $this->auto_brand_model->map_brand_list($this->auto_brand_model->map_brand($where_brand));
//状态
$statusAry = array('0' => '关闭', '1' => '开启');
if($id){
+4 -1
View File
@@ -43,8 +43,11 @@ class Finance extends HD_Controller{
$params['brand_id'] && $where["$t2.brand_id"] = $params['brand_id'];
$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'];
#$params['cor_id'] && $where["$t2.cor_id"] = $params['cor_id'];
#$where[$t2.'.color_id in (select id from lc_auto_attr where status = 1 and type = 0)'] = null;
$where[$t2.'.brand_id in (select id from lc_auto_brand where status = 1)'] = null;
$where[$t2.'.s_id in (select id from lc_auto_series where status = 1)'] = null;
$where[$t2.'.v_id in (select id from lc_auto_attr where status = 1 and type = 1)'] = null;
$total = $this->auto_finance_model->count_finance($where);
$lists = array();
+1
View File
@@ -36,6 +36,7 @@ class Introduce extends HD_Controller
$where['status'] = $params['status'];
}
$where['brand_id in (select id from lc_auto_brand where status > -1)'] = null;
$where['s_id in (select id from lc_auto_series where status > -1)'] = null;
$count = $this->mdAutoIntroduce->count($where);
if ($count) {
$res = $this->mdAutoIntroduce->select($where, "id desc", $params['page'], $params['size']);
+11
View File
@@ -81,11 +81,22 @@ class Series extends HD_Controller{
*/
public function json_lists(){
$brand_id = $this->input->get_post('brand_id');
$status = $this->input->get_post('status');
$page = $this->input->get_post('page');
$size = $this->input->get_post('size');
$where = array('status > -1' => null);
$brand_id && $where['brand_id'] = $brand_id;
if(strlen($status) > 0){
if (strpos($status,'>') !== false || strpos($status,'<') !== false || strpos($status,'in') !== false){
$where["status {$status}"] = null;
}
else{
$where['status'] = $status;
}
} else {
$where['status > -1'] = null;
}
$orderby = 'id desc';
$total = $this->auto_series_model->count($where);
+8 -2
View File
@@ -13,8 +13,8 @@ class Cost extends HD_Controller{
$this->load->model('app/licheb/app_licheb_users_model');
$this->load->model('app/liche/app_liche_orders_model');
$this->load->model('sys/sys_company_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
$this->load->library('receiver/orders_v2_entity');
}
@@ -47,7 +47,7 @@ class Cost extends HD_Controller{
$params['s_id'] = '';
}
if ($params['v_id']) {//车型
$where["v_id"] = $params['v_id'];
//$where["v_id"] = $params['v_id'];
$where_items = $where_items." and v_id = ".$params['v_id'];
} else {
$params['v_id'] = '';
@@ -149,6 +149,12 @@ class Cost extends HD_Controller{
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$autoList = array();
$where = $this->get_where($params);
if ($params['brand_id']) {
$autoList[2] = $this->auto_series_model->select(array('status > -1' => null, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
if ($params['s_id']) {
$autoList[3] = $this->auto_attr_model->select(array('status > -1' => null, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
$count = $this->items_cost_model->count($where);
$lists = [];
+12 -2
View File
@@ -66,14 +66,24 @@ class Goods extends HD_Controller
$where_1['brand_id'] = $params['brand_id'];
$where_2['m.brand_id'] = $params['brand_id'];
$where_3['m.brand_id'] = $params['brand_id'];
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
if (1 == $params['sold']){
$autoList[2] = $this->mdAutoSeries->select(array('status > -1' => null, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
else{
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
}
if ($params['s_id']) {
$where['s_id'] = $params['s_id'];
$where_1['s_id'] = $params['s_id'];
$where_2['m.s_id'] = $params['s_id'];
$where_3['m.s_id'] = $params['s_id'];
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
if (1 == $params['sold']){
$autoList[3] = $this->mdAutoAttr->select(array('status > -1' => null, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
else{
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
}
if ($params['v_id']) {
$where['v_id'] = $params['v_id'];
+2 -2
View File
@@ -46,11 +46,11 @@ class Logs extends HD_Controller
$where['brand_id in (select id from lc_auto_brand where status > -1)'] = null;
if ($params['brand_id']) {
$where['brand_id'] = $params['brand_id'];
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
$autoList[2] = $this->mdAutoSeries->select(array('status > -1' => null, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
if ($params['s_id']) {
$where['s_id'] = $params['s_id'];
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1,'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[3] = $this->mdAutoAttr->select(array('status > -1' => null,'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
if ($params['v_id']) {
$where['v_id'] = $params['v_id'];
+3 -3
View File
@@ -231,7 +231,7 @@
var vm = this;
vm.seryAry = {};
if(nv > 0){
$.get('/auto/series/json_lists',{brand_id:nv},function (data) {
$.get('/auto/series/json_lists',{brand_id:nv, status:1},function (data) {
if (1 == data.code) {
var lists = data.data.list;
var seryAry = {};
@@ -254,12 +254,12 @@
var old_s_id = '<?=$info['s_id']?>';
if (nv > 0) {
//型号
$.get('/auto/attr/json_lists',{s_id:nv,'status':1,'type':1},function (response) {
$.get('/auto/attr/json_lists',{s_id:nv,'status':3,'type':1},function (response) {
if (response.code == 1) {
vm.attrvAry = response.data.list;
}
},'json');
$.get('/auto/attr/json_lists',{s_id:nv,'status':1,'type':0},function (response) {
$.get('/auto/attr/json_lists',{s_id:nv,'status':3,'type':0},function (response) {
if (response.code == 1) {
vm.colorattrvAry = response.data.list;
if(vm.colors){
+2 -2
View File
@@ -265,7 +265,7 @@
url: '/auto/series/json_lists',
type: 'post',
dataType: 'json',
data: {brand_id:nv},
data: {brand_id:nv, status:1},
beforeSend: function () {},
success: function (data) {
if (1 == data.code) {
@@ -300,7 +300,7 @@
dataType: 'json',
data: {
s_id: nv,
status: 1,
status: 3,
type: 1
},
success: function (response) {
+4 -4
View File
@@ -28,7 +28,7 @@
</select>
</div>
</div>
<div class="am-form-group">
<div class="am-form-group" style="display: none">
<div class="am-para-inline w120">
<select name="cor_id" v-model="params.cor_id">
<option value="">车身颜色</option>
@@ -148,7 +148,7 @@
url: '/auto/series/json_lists',
type: 'post',
dataType: 'json',
data: {brand_id:nv},
data: {brand_id:nv, status:1},
beforeSend: function () {},
success: function (data) {
if (1 == data.code) {
@@ -183,7 +183,7 @@
dataType: 'json',
data: {
s_id: nv,
status: 1,
status: 3,
type: 0
},
success: function (response) {
@@ -199,7 +199,7 @@
dataType: 'json',
data: {
s_id: nv,
status: 1,
status: 3,
type: 1
},
success: function (response) {
+2 -2
View File
@@ -5,7 +5,7 @@
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-refurl="/common/auto?pid={value}&type=2&status=1"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -20,7 +20,7 @@
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-refurl="/common/auto?pid={value}&type=3&status=1"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
+3 -3
View File
@@ -104,7 +104,7 @@
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-refurl="/common/auto?pid={value}&type=2&status=1"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -119,7 +119,7 @@
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-refurl="/common/auto?pid={value}&type=3&status=1"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
@@ -694,7 +694,7 @@
dataType: 'json',
data: {
s_id: s_id,
status: 3,
status: 1,
type: 0
},
success: function (response) {
+3 -3
View File
@@ -31,7 +31,7 @@
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-refurl="/common/auto?pid={value}&type=2&status=1"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -46,7 +46,7 @@
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-refurl="/common/auto?pid={value}&type=3&status=1"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
@@ -235,7 +235,7 @@
dataType: 'json',
data: {
s_id: s_id,
status: 3,
status: 1,
type: 0
},
success: function (response) {