dever 3 years ago
parent
commit
1d7e508e90
2 changed files with 11 additions and 2 deletions
  1. 10 1
      app/shop/lib/Info.php
  2. 1 1
      app/shop/src/Buy.php

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

@@ -247,9 +247,14 @@ class Info
             $where['sku_id'] = $sku_id;
         }
         
+        $total = 1;
         $other = Dever::db('shop/goods_sku')->getData($where);
         if (!$other && $check) {
-            return false;
+            if ($check == -1) {
+                $total = 2;
+            } else {
+                return false;
+            }
         }
         
         $data = Dever::load('goods/lib/info')->getInfo($info, $attr, array($other, array('total')));
@@ -277,6 +282,10 @@ class Info
             } else {
                 $data['total'] = $this->getTotal($other, $sku_id);
             }
+
+            if ($total == 2) {
+                $data['total'] = 0;
+            }
         }
 
         return $data;

+ 1 - 1
app/shop/src/Buy.php

@@ -85,7 +85,7 @@ class Buy extends Core
 			Dever::alert('错误的商品');
 		}
 
-		$this->data['goods'] = Dever::load('shop/lib/info')->getGoodsInfo($this->shop_id, $id, false, true, false);
+		$this->data['goods'] = Dever::load('shop/lib/info')->getGoodsInfo($this->shop_id, $id, false, true, -1);
 
 		//$this->data['shop'] = $this->shop;