短信验证码 保存7天
This commit is contained in:
@@ -27,7 +27,6 @@ class Cron
|
||||
//每周执行
|
||||
/*工会补贴生成开始
|
||||
*房间补贴生成开始
|
||||
* 过期验证码删除
|
||||
*/
|
||||
public function PerformPerWeek()
|
||||
{
|
||||
@@ -53,6 +52,7 @@ class Cron
|
||||
* 清除房间热度值
|
||||
* 清除房间离线超24小时的用户
|
||||
* 系统降身价
|
||||
* 过期验证码删除
|
||||
*/
|
||||
public function DaySeconds()
|
||||
{
|
||||
|
||||
@@ -26,6 +26,10 @@ class DaySeconds
|
||||
echo "系统降身价:\n";
|
||||
$this->system_downgrade();
|
||||
echo "\n";
|
||||
|
||||
echo "过期验证码删除:\n";
|
||||
$this->deleteExpireCode();
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -138,4 +142,15 @@ class DaySeconds
|
||||
}
|
||||
|
||||
|
||||
//删除过期的短信验证码
|
||||
public function deleteExpireCode(){
|
||||
$time = time() - 60 * 60 * 24 * 7;
|
||||
$code = db::name('sms')->where(['createtime' => ['<',$time]])->select();
|
||||
if ($code) {
|
||||
foreach ($code as $key => $value) {
|
||||
db::name('sms')->where(['id' => $value['id']])->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,9 +24,6 @@ class Subsidy
|
||||
$this->createRoomSubsidyData();//房间补贴数据
|
||||
echo "\n";
|
||||
|
||||
echo "过期验证码删除:\n";
|
||||
$this->deleteExpireCode();
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -176,14 +173,5 @@ class Subsidy
|
||||
}
|
||||
|
||||
|
||||
//删除过期的短信验证码
|
||||
public function deleteExpireCode(){
|
||||
$time = time() - 60 * 60 * 24 * 7;
|
||||
$code = db::name('sms')->where(['createtime' => ['<',$time]])->select();
|
||||
if ($code) {
|
||||
foreach ($code as $key => $value) {
|
||||
db::name('sms')->where(['id' => $value['id']])->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user