Expire.php 386 B

1234567891011121314151617
  1. <?php
  2. namespace app\Admin\controller;
  3. use think\Db;
  4. class Expire
  5. {
  6. public function update(){
  7. $acocunt =Db::name('Account')->where("is_del=0 and status>=1 and expiretime<='".date("Y-m-d H:i:s")."'")->select();
  8. foreach ($acocunt as $value){
  9. Db::name("Account")->where($value)->update(['status'=>2,"updatetime"=>date("Y-m-d H:i:s")]);
  10. }
  11. }
  12. }