新增搜索商品库存字段返回
This commit is contained in:
@@ -214,6 +214,7 @@ class BasicDataService extends BaseService
|
||||
|
||||
$fields = [
|
||||
'product_id',
|
||||
'product_platform_id',
|
||||
'product_name',
|
||||
'product_price',
|
||||
'product_cover_img',
|
||||
@@ -237,6 +238,12 @@ class BasicDataService extends BaseService
|
||||
$item['product_cover_img'] = addAliyunOssWebsite($item['product_cover_img']);
|
||||
|
||||
$item['product_name'] = $item['product_name'] . ' ' . $item['product_spec'];
|
||||
$item['stock'] = 0;
|
||||
if (!empty($item['ProductPlatformAmount'])){
|
||||
$item['stock'] = $item['ProductPlatformAmount']['stock'];
|
||||
}
|
||||
|
||||
unset($item['ProductPlatformAmount']);
|
||||
}
|
||||
|
||||
return success($product->toArray());
|
||||
|
||||
Reference in New Issue
Block a user