goods_708_2

This commit is contained in:
dengbw
2022-07-08 16:29:50 +08:00
parent a8173f9f35
commit 344efcd220
7 changed files with 34 additions and 28 deletions
+12 -6
View File
@@ -1476,24 +1476,30 @@ class Common extends CI_Controller
$pid = intval($this->input->get('pid'));
$name = $this->input->get('name');
$tp = intval($this->input->get('tp'));//0搜索使用,1修改使用
$status = intval($this->input->get('status'));
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->load->model('auto/auto_attr_model', 'mdAutoAttr');
$res = $lists = array();
$res = $lists = $where = [];
if ($status == 3) {//搜索专用
$where['status'] = 1;
} else {
$where['status>'] = -1;
}
if ($type == 1) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择品牌');
$res = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
$res = $this->mdAutoBrand->select($where, 'id desc', 0, 0, 'id,name');
} else if ($type == 2) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车系');
$res = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $pid), 'id desc', 0, 0, 'id,name');
$res = $this->mdAutoSeries->select(array_merge($where, ['brand_id' => $pid]), 'id desc', 0, 0, 'id,name');
} else if ($type == 3) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车型');
$res = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');
$res = $this->mdAutoAttr->select(array_merge($where, ['type' => 1, 's_id' => $pid]), 'id desc', 0, 0, 'id,title as name');
}
if ($tp == 1 && $type == 3) {
$lists[3] = $res;//车型
$lists[4] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 0, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');//车身颜色
$lists[5] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 2, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');//内饰颜色
$lists[4] = $this->mdAutoAttr->select(array_merge($where, ['type' => 0, 's_id' => $pid]), 'id desc', 0, 0, 'id,title as name');//车身颜色
$lists[5] = $this->mdAutoAttr->select(array_merge($where, ['type' => 2, 's_id' => $pid]), 'id desc', 0, 0, 'id,title as name');//内饰颜色
} else {
foreach ($res as $key => $value) {
$lists[] = array('id' => $value['id'], 'name' => $value['name']);
+5 -5
View File
@@ -198,11 +198,11 @@ class Attr extends HD_Controller
$where = array();
$s_id && $where['s_id'] = $s_id;
strlen($type) > 0 && $where['type'] = $type;
// if (strlen($status) > 0) {
// $where['status'] = $status;
// } else {
// $where['status>-1'] = null;
// }
if ($status == 3) {//搜索专用
$where['status'] = 1;
} else {
$where['status>'] = -1;
}
$where['status>-1'] = null;
$total = $this->auto_attr_model->count($where);
$lists = array();
+5 -5
View File
@@ -410,12 +410,12 @@ class Goods extends HD_Controller
$info['out_time'] = $re['out_time'] != '0000-00-00 00:00:00' ? $re['out_time'] : '';
$info['bill_time'] = $re['bill_time'] != '0000-00-00 00:00:00' ? $re['bill_time'] : '';
if ($re['brand_id']) {
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $re['brand_id']), 'id desc', 0, 0, 'id,name');
$autoList[2] = $this->mdAutoSeries->select(array('status>' => -1, 'brand_id' => $re['brand_id']), 'id desc', 0, 0, 'id,name');
}
if ($re['s_id']) {
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1,'type' => 1, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[4] = $this->mdAutoAttr->select(array('status' => 1,'type' => 0, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[5] = $this->mdAutoAttr->select(array('status' => 1,'type' => 2, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[3] = $this->mdAutoAttr->select(array('status>' => -1,'type' => 1, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[4] = $this->mdAutoAttr->select(array('status>' => -1,'type' => 0, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[5] = $this->mdAutoAttr->select(array('status>' => -1,'type' => 2, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
}
$info['city_id'] = '';
$info['county_id'] = '';
@@ -445,7 +445,7 @@ class Goods extends HD_Controller
$_title = '新增商品';
$edit_url = '/items/goods/goods/add';
}
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
$autoList[1] = $this->mdAutoBrand->select(array('status>' => -1), 'id desc', 0, 0, 'id,name');
$showInfo['autoList'] = $autoList;
$showInfo['comList'] = $comList;
$showInfo['statusAry'] = $this->statusAry;
+3 -3
View File
@@ -9,7 +9,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"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -24,7 +24,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"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
@@ -611,7 +611,7 @@
dataType: 'json',
data: {
s_id: s_id,
status: 1,
status: 3,
type: 0
},
success: function (response) {
+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"
data-refurl="/common/auto?pid={value}&type=2&status=3"
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"
data-refurl="/common/auto?pid={value}&type=3&status=3"
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: 1,
status: 3,
type: 0
},
success: function (response) {
+3 -3
View File
@@ -7,7 +7,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"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -22,7 +22,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"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
@@ -209,7 +209,7 @@
dataType: 'json',
data: {
s_id: s_id,
status: 1,
status: 3,
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"
data-refurl="/common/auto?pid={value}&type=2&status=3"
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"
data-refurl="/common/auto?pid={value}&type=3&status=3"
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: 1,
status: 3,
type: 0
},
success: function (response) {