1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\index\controller;
- use think\Controller;
- use think\Db;
- use think\Cache;
- class Plantask extends Controller
- {
-
- public function auto_user_active(){
- $actitime = time() - 7200;
- $sql = 'update `mt_user` set is_active = 0 where is_active = 1 and id in (select user_id from mt_user_active where requesttime < '.$actitime.')';
- db()->query($sql);
- }
-
-
- public function auto_vipend(){
- $sql2 = 'update `mt_user` set is_vip = 0 where is_vip = 1 and user_id in (select user_id from mt_user_wallet where vip_endtime > 0 and vip_endtime < '.time().')';
- db()->query($sql2);
- }
- }
|