From 344efcd2203a62f8049d212287c5867434005796 Mon Sep 17 00:00:00 2001 From: dengbw Date: Fri, 8 Jul 2022 16:29:50 +0800 Subject: [PATCH] goods_708_2 --- admin/controllers/Common.php | 18 ++++++++++++------ admin/controllers/auto/Attr.php | 10 +++++----- admin/controllers/items/goods/Goods.php | 10 +++++----- admin/views/items/goods/lists.php | 6 +++--- admin/views/items/goods/lists_sold.php | 6 +++--- admin/views/items/inventory/lists_log.php | 6 +++--- admin/views/items/logs/lists.php | 6 +++--- 7 files changed, 34 insertions(+), 28 deletions(-) diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php index 054d13f3..1fd31a8c 100644 --- a/admin/controllers/Common.php +++ b/admin/controllers/Common.php @@ -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']); diff --git a/admin/controllers/auto/Attr.php b/admin/controllers/auto/Attr.php index 46bacf53..f9285755 100644 --- a/admin/controllers/auto/Attr.php +++ b/admin/controllers/auto/Attr.php @@ -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(); diff --git a/admin/controllers/items/goods/Goods.php b/admin/controllers/items/goods/Goods.php index 3129546e..ceb70158 100644 --- a/admin/controllers/items/goods/Goods.php +++ b/admin/controllers/items/goods/Goods.php @@ -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; diff --git a/admin/views/items/goods/lists.php b/admin/views/items/goods/lists.php index 5dd6893e..e7178cc3 100644 --- a/admin/views/items/goods/lists.php +++ b/admin/views/items/goods/lists.php @@ -9,7 +9,7 @@
车型:
车型:
车型: