修复错误

This commit is contained in:
mkm 2023-05-19 21:35:30 +08:00
parent a5ec83b8f6
commit 52690a7a82

View File

@ -46,9 +46,13 @@ class StoreMicro extends BaseController
if ($mer_id==0) return app('json')->fail('商户id不能为空');
$find=Db::name('store_product')->where('product_id',$product_id)->find();
if($find){
if($find['product_type']!=0){
return app('json')->fail('该商品不是普通商品');
}
$find['attrValue']=Db::name('store_product_attr_value')->where('product_id',$find['product_id'])->field('image,price,cost,ot_price,svip_price,stock,bar_code,weight,volume')->select();
$find['content']=Db::name('store_product_content')->where('product_id',$find['product_id'])->value('content');
$find['is_show']=0;
$find['mer_status']=1;
$find['mer_id']=$mer_id;
$find['temp_id']="";
$find['give_coupon_ids']=[];
@ -61,6 +65,9 @@ class StoreMicro extends BaseController
$find["guarantee_template_id"] = "";
$find['product_type']=0;
$find['mer_cate_id']=[0 => 0];
$find['is_used']=1;
$find['status']=1;
$find['mer_status']=1;
unset($find['product_id'],$find['create_time']);
}
$make = app()->make(ProductRepository::class);