Timedtask.php 691 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\api\controller;
  3. use AlibabaCloud\Client\AlibabaCloud;
  4. use AlibabaCloud\Client\Exception\ClientException;
  5. use AlibabaCloud\Client\Exception\ServerException;
  6. use think\Db;
  7. /**
  8. * @title 定时任务
  9. * Class Timedtask
  10. * @controller Timedtask
  11. * @group base
  12. */
  13. class Timedtask
  14. {
  15. /**
  16. * @title 会员优惠券过期
  17. * @desc 会员优惠券过期
  18. * @author qc
  19. * @url /api/Timedtask/userCouponOver
  20. * @method GET
  21. */
  22. public function userCouponOver()
  23. {
  24. Db::table('user_coupon_list')
  25. ->where('past_at','> time',date('Y-m-d H:i:s'))
  26. ->where('status','=',1)
  27. ->update(['status'=>3]);
  28. }
  29. }