价格增加百分比上浮

This commit is contained in:
liu
2026-08-06 14:52:56 +08:00
parent 07b08c8915
commit c6f69c5c55
19 changed files with 958 additions and 93 deletions
@@ -88,9 +88,10 @@ class ProductController extends BaseMiniController
->paginate($pageSize)
->toArray();
// 扁平化价格:prices[0].price → price(未设等级价为 null
// 扁平化价格:prices[0].actual_price → price访问器经 toArray 自动输出换算后实际价;未设等级价为 null
// unset prices 同时移除 price_type/percent,门店端无法反推成本;cost_price 已被 $hidden 过滤
foreach ($data['data'] as &$row) {
$row['price'] = $row['prices'][0]['price'] ?? null;
$row['price'] = $row['prices'][0]['actual_price'] ?? null;
unset($row['prices']);
}