dever 3 years ago
parent
commit
291014e656
2 changed files with 22 additions and 4 deletions
  1. 17 0
      app/goods/database/info.php
  2. 5 4
      app/goods/lib/Set.php

+ 17 - 0
app/goods/database/info.php

@@ -558,6 +558,23 @@ $config = array
             'col' => '*',
         ),
 
+        # 列表
+        'getData' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'price_type' => array('yes', 'in'),
+                'status' => 1,
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('reorder' => 'desc', 'id' => 'desc'),
+            //'limit' => '0,10',
+            //'page' => array(10, 'list'),
+            'col' => '*',
+        ),
+
         # 分页
         'getPageAll' => array
         (

+ 5 - 4
app/goods/lib/Set.php

@@ -11,14 +11,15 @@ class Set
     {
         $where['status'] = 1;
 
-        $data = Dever::db('goods/info')->select($where);
+        if ($type != 'factory_id') {
+            $where['price_type'] = '1,2,3';
+        }
+        $data = Dever::db('goods/info')->getData($where);
 
         $result = array();
         if ($data) {
             foreach ($data as $k => $v) {
-                if ($type != 'factory_id' && $v['price_type'] == 4) {
-                    continue;
-                }
+                
                 $sku = Dever::db('goods/info_sku')->select(array('info_id' => $v['id']));
 
                 if ($sku) {