|
@@ -679,8 +679,8 @@ class Goodup extends BaseController
|
|
|
if($data==false){
|
|
|
return error_show(1004,"未找到商品数据");
|
|
|
}
|
|
|
- $unit =Db::name("unit")->where(["unit"=>$data['good_unit']])->find();
|
|
|
- $data['unit_id'] = isset($unit['id'])?$unit['id']:0;
|
|
|
+ $unit =Db::name("unit")->where(["id"=>$data['good_unit']])->find();
|
|
|
+ $data['unit'] = isset($unit['unit'])?$unit['unit']:'';
|
|
|
$data['cat_info'] = made($data['cat_id'],[]);
|
|
|
$spec = Db::name("good_spec")->where(["spuCode"=>$supcode,"is_del"=>0])->select()->toArray();
|
|
|
$supplier = Db::name("supplier")->where(["code"=>$data['supplierNo']])->find();
|
|
@@ -689,8 +689,13 @@ class Goodup extends BaseController
|
|
|
$data['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
|
|
|
$company = Db::name("business")->where(["companyNo"=>$data['companyNo']])->find();
|
|
|
$data['company'] = isset($company['company'])?$company['company']:"";
|
|
|
- $brand=Db::name("brand")->where(["id"=>$data['brand_id']])->find();
|
|
|
- $data["brand_name"]=isset($brand['brand_name'])?$brand['brand_name']:"";
|
|
|
+ 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']:"";
|
|
|
+ }else{
|
|
|
+ $data["brand_name"]="";
|
|
|
+ $data["brand_id"]="";
|
|
|
+ }
|
|
|
$data["good_info_img"]=$data['good_info_img']!=""? json_decode($data['good_info_img'],true):[];
|
|
|
$speclist=[];
|
|
|
if(!empty($spec)){
|