From cbf3eaf7886d8607eff070987b729886f70a1de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Mon, 26 Jan 2026 19:26:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=88=86=E5=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/adminapi/controller/Lottery.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/application/adminapi/controller/Lottery.php b/application/adminapi/controller/Lottery.php index 3951f3a5..a61ae42f 100644 --- a/application/adminapi/controller/Lottery.php +++ b/application/adminapi/controller/Lottery.php @@ -17,8 +17,7 @@ use think\Validate; */ class Lottery extends adminApi { - // Redis实例 - private $redis; + protected $noNeedLogin = []; protected $noNeedRight = []; public function _initialize() @@ -53,8 +52,8 @@ class Lottery extends adminApi ]; db::name("bb_lottery_config")->where(['key'=>$k])->update($data); } - $this->redis = Cache::store('redis')->handler(); - $prize_amount = $this->redis->get('lottery:small_pool:total_gold'); + + $prize_amount = Cache::get('lottery:small_pool:total_gold'); Db::name('bb_lottery_winner_record')->insert([ 'uid' => 0, @@ -67,9 +66,9 @@ class Lottery extends adminApi 'status' => 0 // 未发放 ]); //清除缓存 - $this->redis->rm('lottery:small_pool:round'); - $this->redis->rm('lottery:small_pool:total_times'); - $this->redis->rm('lottery:small_pool:total_gold'); + Cache::rm('lottery:small_pool:round'); + Cache::rm('lottery:small_pool:total_times'); + Cache::rm('lottery:small_pool:total_gold'); return V(1,"成功"); }