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