This commit is contained in:
2026-01-26 19:36:22 +08:00
parent 853fb0b89e
commit cf6ac7c0b1

View File

@@ -17,7 +17,8 @@ use think\Validate;
*/
class Lottery extends adminApi
{
// Redis实例
private $redis;
protected $noNeedLogin = [];
protected $noNeedRight = [];
public function _initialize()
@@ -52,8 +53,8 @@ class Lottery extends adminApi
];
db::name("bb_lottery_config")->where(['key'=>$k])->update($data);
}
$prize_amount = Cache::get('lottery:small_pool:total_gold');
$this->redis = Cache::store('redis')->handler();
$prize_amount = $this->redis->get('lottery:small_pool:total_gold');
Db::name('bb_lottery_winner_record')->insert([
'uid' => 0,
@@ -66,9 +67,9 @@ class Lottery extends adminApi
'status' => 0 // 未发放
]);
//清除缓存
Cache::rm('lottery:small_pool:round');
Cache::rm('lottery:small_pool:total_times');
Cache::rm('lottery:small_pool:total_gold');
$this->redis->rm('lottery:small_pool:round');
$this->redis->rm('lottery:small_pool:total_times');
$this->redis->rm('lottery:small_pool:total_gold');
return V(1,"成功");
}