新增搜索商品库存字段返回

This commit is contained in:
2023-03-23 17:20:03 +08:00
parent 9dd6116f44
commit 983f4d8909
8 changed files with 106 additions and 10 deletions
+7
View File
@@ -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());