wugg 1 年間 前
コミット
31f97c0902
1 ファイル変更5 行追加0 行削除
  1. 5 0
      app/admin/controller/Good.php

+ 5 - 0
app/admin/controller/Good.php

@@ -403,6 +403,7 @@ class Good extends Base
         $data['noble_name']=isset($data['noble_metal'])&&$data['noble_metal']!=0?$this->noble[$data['noble_metal']] :"";
         $data['combind_list']=[];
         $data['wsm_list']=[];
+        $data['is_combind_child']=false;
 		 if($data['is_combind']==1){
         	$data['combind_list'] = (new GoodCombind())->where(['spuCode'=>$good_platform['spuCode'],'is_del'=>0])->select()->toArray();
         	foreach ($data['combind_list'] as &$item){
@@ -411,7 +412,11 @@ class Good extends Base
         	  $data['wsm_list']=(new GoodStock())->withJoin(['wsminfo'] , 'left')
 	                                           ->where(['spuCode'=>$good_platform['spuCode'] , 'wsm_type'=>[2 , 5]])
 	                                           ->column('good_stock.id stock_id,name,good_stock.wsm_code,usable_stock');
+        }else{
+		 $isCombind= (new GoodCombind())->where(['childCode'=>$good_platform['spuCode'],'is_del'=>0])->findOrEmpty();
+		 $data['is_combind_child']=$isCombind->isEmpty();
         }
+		 
         if($data['brand_id']!=0){
             $brand=Db::name("brand")->where(["id"=>$data['brand_id']])->find();
             $data["brand_name"]=isset($brand['brand_name'])?$brand['brand_name']:"";