Plantask.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. use think\Db;
  5. use think\Cache;
  6. class Plantask extends Controller
  7. {
  8. //超时未支付订单,自动取消
  9. public function auto_cancel_nopay_order(){
  10. }
  11. //超时未接诊订单,自动取消,并退款
  12. public function aoto_cancel_noaccept_order(){
  13. }
  14. /////////////////////////////////////////////////////////////////////////
  15. //定时跑用户活跃,改成离线
  16. public function auto_user_active(){
  17. $actitime = time() - 7200;
  18. $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.')';
  19. db()->query($sql);
  20. }
  21. //vip过期的,三个隐私设置改成0
  22. //vip过期的,更新用户表is_vip
  23. public function auto_vipend(){
  24. // $sql = 'update `mt_user_power` set yinsi = 0,yinshen = 0,wuhen = 0 where user_id in (select user_id from mt_user_wallet where vip_endtime > 0 and vip_endtime < '.time().')';
  25. // db()->query($sql);
  26. /*$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().')';
  27. db()->query($sql2);*/
  28. }
  29. }