Plantask.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. //未支付订单N分钟后自动取消
  9. public function auto_cancel_nopay_order(){
  10. }
  11. //自动取消未接诊订单
  12. public function auto_cancel_noaccept_order(){
  13. }
  14. //视频订单接诊后,并第一次拨打N分钟自动结束
  15. public function auto_finish_accept_videoorder(){
  16. }
  17. /////////////////////////////////////////////////////////////////////////
  18. //定时跑用户活跃,改成离线
  19. public function auto_user_active(){
  20. $actitime = time() - 7200;
  21. $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.')';
  22. db()->query($sql);
  23. }
  24. //vip过期的,三个隐私设置改成0
  25. //vip过期的,更新用户表is_vip
  26. public function auto_vipend(){
  27. // $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().')';
  28. // db()->query($sql);
  29. /*$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().')';
  30. db()->query($sql2);*/
  31. }
  32. }