This commit is contained in:
yangduo 2025-01-14 17:51:24 +08:00
parent 4cbf851340
commit 7c8d785ecd

View File

@ -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,
));
}
}
}
}
}