dever 3 years ago
parent
commit
df3c9ecec3
3 changed files with 9 additions and 2 deletions
  1. 3 0
      app/shop/database/goods.php
  2. 1 1
      app/shop/lib/Goods.php
  3. 5 1
      app/shop/lib/Info.php

+ 3 - 0
app/shop/database/goods.php

@@ -308,6 +308,8 @@ return array
                 'hot' => array('yes-t_2.hot'),
                 'top' => array('yes-t_2.top'),
                 //'youhui' => array('yes-t_2.youhui'),
+                'price_type' => array('yes-t_2.price_type', 'in'),
+                'sell_type' => array('yes-t_2.sell_type'),
                 'name' => array('yes-t_2.name', 'like'),
                 'column' => array('yes-t_2.column_id', 'like'),
                 'category' => array('yes-t_2.category', 'like'),
@@ -343,6 +345,7 @@ return array
                 'top' => array('yes-t_2.top'),
                 //'youhui' => array('yes-t_2.youhui'),
                 'price_type' => array('yes-t_2.price_type', 'in'),
+                'sell_type' => array('yes-t_2.sell_type'),
                 'name' => array('yes-t_2.name', 'like'),
                 'column' => array('yes-t_2.column_id', 'like'),
                 'category' => array('yes-t_2.category', 'like'),

+ 1 - 1
app/shop/lib/Goods.php

@@ -22,7 +22,7 @@ class Goods
         $data['shop'] = Dever::load('shop/lib/info')->getOne($shop_id, $lng, $lat);
         if ($column) {
             foreach ($column as $k => $v) {
-                $v['data'] = Dever::load('shop/lib/info')->getGoods($shop_id, $v['id']);
+                $v['data'] = Dever::load('shop/lib/info')->getGoods($shop_id, $v['id'], false, 1);
                 $data['cate'][] = $v;
             }
         }

+ 5 - 1
app/shop/lib/Info.php

@@ -59,7 +59,7 @@ class Info
     }
 
     # 获取店铺的商品列表
-    public function getGoods($shop, $column = false, $price_type = false)
+    public function getGoods($shop, $column = false, $price_type = false, $sell_type = false)
     {
         $table = 'shop/goods';
         $where['shop_id'] = isset($shop['id']) ? $shop['id'] : $shop;
@@ -79,6 +79,10 @@ class Info
             $where['price_type'] = $price_type;
         }
 
+        if ($sell_type) {
+            $where['sell_type'] = $sell_type;
+        }
+
         $where['status'] = 1;
         $where['state'] = 1;