短信验证码 保存7天
This commit is contained in:
@@ -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