Your Name пре 3 година
родитељ
комит
3b54b41534
2 измењених фајлова са 23 додато и 1 уклоњено
  1. 19 0
      app/goods/database/info.php
  2. 4 1
      app/shop/lib/Info.php

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

@@ -29,6 +29,12 @@ $yes = array
     2 => '否',
     2 => '否',
 );
 );
 
 
+$sku_type = array
+(
+    1 => '库存不足时不显示商品',
+    2 => '库存不足时显示商品',
+);
+
 $column = function()
 $column = function()
 {
 {
     $array = array();
     $array = array();
@@ -201,6 +207,19 @@ $config = array
             //'list'      => true,
             //'list'      => true,
         ),
         ),
 
 
+        'sku_type'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '商品库存',
+            'default'   => '1',
+            'desc'      => '商品库存',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $sku_type,
+            //'list'      => true,
+            //'edit'      => true,
+        ),
+
         'tag_id'        => array
         'tag_id'        => array
         (
         (
             'type'      => 'varchar-800',
             'type'      => 'varchar-800',

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

@@ -164,7 +164,10 @@ class Info
                 $d = $this->getGoodsInfo($where['shop_id'], $v, false, true, true, $uid);
                 $d = $this->getGoodsInfo($where['shop_id'], $v, false, true, true, $uid);
                 if ($d) {
                 if ($d) {
                     if ($d['total'] <= 0) {
                     if ($d['total'] <= 0) {
-                        $result_2[] = $d;
+                        if ($d['sku_type'] == 2) {
+                            $result_2[] = $d;
+                        }
+                        // $result_2[] = $d;
                     } else {
                     } else {
                         $result_1[] = $d;
                         $result_1[] = $d;
                     }
                     }