From 44ed34f1e659b9eb361f2cacdc34a7e2528f0801 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 31 Jul 2024 14:09:45 +0800 Subject: [PATCH] 1 --- webapp/controller/BattleController.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 1df9b735..90c1f6b1 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -1289,4 +1289,16 @@ class BattleController extends BaseAuthedController { return empty($num) ? 0 : $num; } + private function incAlreadyAllocBoxNum($val) + { + $key = 'box_daily_already_alloc_num:' . myself()->_getNowDaySeconds(); + $r = $this->_getRedis($key); + $num = intval($r->get($key)); + if (empty($num)) { + $r->setPx($key, $val, 1000 * 3600 * 24 * 7); + } else { + $r->setPx($key, $num + $val, 1000 * 3600 * 24 * 7); + } + } + }