diff --git a/webapp/controller/RechargeController.class.php b/webapp/controller/RechargeController.class.php index 960bf4f..eedd480 100644 --- a/webapp/controller/RechargeController.class.php +++ b/webapp/controller/RechargeController.class.php @@ -690,7 +690,42 @@ class RechargeController } if ($rechargerow['daily_purchase'] != null && $rechargerow['daily_purchase'] != '') { - $dailypurchase = json_decode($rechargerow['daily_purchase']); + $dailypurchase = json_decode($rechargerow['daily_purchase'], true); + $packtime = 0; + foreach($dailypurchase as $key => $val) { + if ($val['id'] == 10 && $val['time'] > $daysecs) { + $packtime = $val['time']; + } + } + + if ($packtime > 0) { + $shopconf = metatable\getShopGoodsConf(); + foreach($shopconf as $itemconf) { + if ($itemconf['type'] != 2) { + continue; + } + + if ($itemconf['shop_id'] == 10) { + continue; + } + + $found = false; + foreach($dailypurchase as $key => $val) { + if ($val['id'] == $itemconf['shop_id']) { + $found = true; + $dailypurchase[$key]['time'] = $packtime; + break; + } + } + + if (!$found) { + array_push($dailypurchase, array( + 'id' => $shopconf['shop_id'], + 'time' => $packtime, + )); + } + } + } } }