From 486962f875fc063c896ec13d2ad6109572914dea Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 4 Apr 2023 21:19:31 +0800 Subject: [PATCH] ... --- webapp/controller/ShopController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 6b8a38f8..11bbacd5 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -52,7 +52,7 @@ class ShopController extends BaseAuthedController $goodsList = $goodsList ? $goodsList : array(); $buyRecordHash = ShopBuyRecord::allToHash(); - foreach ($goodsList as $goods) { + foreach ($goodsList as &$goods) { $goods['bought_times'] = 0; switch ($goods['limit_type']) { case mt\Item::DAILY_BUY_LIMIT: { @@ -62,12 +62,12 @@ class ShopController extends BaseAuthedController break; case mt\Item::WEEKLY_BUY_LIMIT: { $buyRecord = getXVal($buyRecordHash, $goods['id']); - $goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0; + $goods['bought_times'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0; } break; case mt\Item::TOTAL_BUY_LIMIT: { $buyRecord = getXVal($buyRecordHash, $goods['id']); - $goodsDto['bought_times'] = $buyRecord ? $buyRecord['total_buy_times'] : 0; + $goods['bought_times'] = $buyRecord ? $buyRecord['total_buy_times'] : 0; } break; default: {