Browse Source

wes 多宝福袋wesmiler

wesmiler 2 years ago
parent
commit
58ce747af2
1 changed files with 8 additions and 0 deletions
  1. 8 0
      app/admin/logic/ShopGoodsLogic.php

+ 8 - 0
app/admin/logic/ShopGoodsLogic.php

@@ -94,6 +94,14 @@ class ShopGoodsLogic
         $specAttrId           = isset($specRelation[0])?ShopGoodsSpecType::getPidById($specRelation[0]['spec_id']):0;
         if ($data['is_exist_many_spec'] == 0) {
             $data['defaultSku'] = ShopGoodsSpec::getGoodsSpecByGoodId($id);
+            if(empty($data['defaultSku'])){
+                $data['defaultSku'] = [
+                    'price'=> 0.00,
+                    'original_price'=>0.00,
+                    'cost_price'=>0.00,
+                    'stock'=> 0,
+                ];
+            }
         }
 
         $hot_keywords    = ShopHotKeywordsLogic::getCacheList();