From c374161fdba57bd77c44fc5d6f2c0e9cd8dbc2d6 Mon Sep 17 00:00:00 2001 From: dengbw Date: Fri, 3 Dec 2021 15:18:46 +0800 Subject: [PATCH] admin_goods_1203 --- admin/controllers/items/goods/Goods.php | 31 ++- admin/views/items/goods/lists.php | 259 +++++++++++++---------- admin/views/items/goods/lists_sold.php | 10 - api/controllers/wxapp/material/Home.php | 5 +- api/controllers/wxapp/material/Topic.php | 1 + 5 files changed, 179 insertions(+), 127 deletions(-) diff --git a/admin/controllers/items/goods/Goods.php b/admin/controllers/items/goods/Goods.php index 83d70698..a123a6ff 100644 --- a/admin/controllers/items/goods/Goods.php +++ b/admin/controllers/items/goods/Goods.php @@ -37,6 +37,21 @@ class Goods extends HD_Controller $where_1 = $where_2 = $where_3 = array('m.id<>1' => null); $autoList = array(); $search_type = 0;//0不连表,1联表筛选精品,2联表筛选销售,3联表筛选精品和销售 + if ($params['in_time']) { + $in_time = explode(' ~ ', $params['in_time']); + if ($in_time[0]) { + $where['in_time >='] = $in_time[0] . ' 00:00:00'; + $where_1['in_time >='] = $in_time[0] . ' 00:00:00'; + $where_2['m.in_time >='] = $in_time[0] . ' 00:00:00'; + $where_3['m.in_time >='] = $in_time[0] . ' 00:00:00'; + } + if ($in_time[1]) { + $where['in_time <='] = $in_time[1] . ' 23:59:59'; + $where_1['in_time <='] = $in_time[1] . ' 23:59:59'; + $where_2['m.in_time <='] = $in_time[1] . ' 23:59:59'; + $where_3['m.in_time <='] = $in_time[1] . ' 23:59:59'; + } + } if ($params['brand_id']) { $where['brand_id'] = $params['brand_id']; $where_1['brand_id'] = $params['brand_id']; @@ -84,12 +99,26 @@ class Goods extends HD_Controller $params['city_id'] && $where_biz['city_id'] = $params['city_id']; $params['county_id'] && $where_biz['county_id'] = $params['county_id']; $res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id'); - if ($res_biz) { + $res_addr = $this->addr_model->select($where_biz, 'id desc', 0, 0, 'id'); + if ($res_biz && $res_addr) { + $str_ids = implode(',', array_column($res_biz, 'id')); + $str_addr_ids = implode(',', array_column($res_addr, 'id')); + $where["biz_id in ({$str_ids}) or addr_id in ({$str_addr_ids})"] = null; + $where_1["biz_id in ({$str_ids}) or addr_id in ({$str_addr_ids})"] = null; + $where_2["m.biz_id in ({$str_ids}) or m.addr_id in ({$str_addr_ids})"] = null; + $where_3["m.biz_id in ({$str_ids}) or m.addr_id in ({$str_addr_ids})"] = null; + } else if ($res_biz) { $str_ids = implode(',', array_column($res_biz, 'id')); $where["biz_id in ({$str_ids})"] = null; $where_1["biz_id in ({$str_ids})"] = null; $where_2["m.biz_id in ({$str_ids})"] = null; $where_3["m.biz_id in ({$str_ids})"] = null; + } else if ($res_addr) { + $str_addr_ids = implode(',', array_column($res_addr, 'id')); + $where["addr_id in ({$str_addr_ids})"] = null; + $where_1["addr_id in ({$str_addr_ids})"] = null; + $where_2["m.addr_id in ({$str_addr_ids})"] = null; + $where_3["m.addr_id in ({$str_addr_ids})"] = null; } else { $where['biz_id'] = -2; $where_1['biz_id'] = -2; diff --git a/admin/views/items/goods/lists.php b/admin/views/items/goods/lists.php index 9a81ea5e..5568cc09 100644 --- a/admin/views/items/goods/lists.php +++ b/admin/views/items/goods/lists.php @@ -1,98 +1,3 @@ - - -
-
- -
- -
-
- -
+ +
+
+
+
+ +
+ +
+
+ +
+
@@ -240,15 +162,6 @@ -
- - - ID - - - - - @@ -300,7 +213,6 @@