123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <?php
- namespace crmeb\subscribes;
- use app\admin\model\system\SystemAttachment;
- use app\api\controller\trade\CashTradeController;
- use app\models\manage\UserBorrowMoney;
- use app\models\manage\UserManageMoney;
- use app\models\mining\UserMiningMachine;
- use app\models\point_plan\UserPointPlan;
- use app\models\store\StoreBargainUser;
- use app\models\store\StoreOrder;
- use app\models\store\StorePink;
- use app\models\trade\CashTradeOrder;
- use app\models\user\UserToken;
- use app\models\vote\VoteSub;
- use think\facade\Db;
- /**
- * 定时任务类
- * Class TaskSubscribe
- * @package crmeb\subscribes
- */
- class TaskSubscribe
- {
- public function handle()
- {
- }
- /**
- * 2秒钟执行的方法
- */
- public function onTask_2()
- {
- }
- /**
- * 6秒钟执行的方法
- */
- public function onTask_6()
- {
- }
- /**
- * 10秒钟执行的方法
- */
- public function onTask_10()
- {
- try {
- Db::startTrans();
- VoteSub::checkAllStop();//拼团到期修改状态
- Db::commit();
- } catch (\Exception $e) {
- Db::rollback();
- }
- try {
- Db::startTrans();
- VoteSub::robotOrder();
- Db::commit();
- } catch (\Exception $e) {
- Db::rollback();
- }
- }
- /**
- * 30秒钟执行的方法
- */
- public function onTask_30()
- {
- try {
- Db::startTrans();
- CashTradeOrder::orderClose();//挂出结束退回
- Db::commit();
- } catch (\Exception $e) {
- Db::rollback();
- }
- // try {
- // Db::startTrans();
- // StoreBargainUser::startBargainUserStatus();//批量修改砍价状态为 砍价失败
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- // try {
- // Db::startTrans();
- // StoreOrder::orderUnpaidCancel();//订单未支付默认取消
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- // try {
- // Db::startTrans();
- // StoreOrder::startTakeOrder();//7天自动收货
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- // try {
- // Db::startTrans();
- // StorePink::statusPink();//拼团到期修改状态
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- // try {
- // Db::startTrans();
- // UserPointPlan::day_release();//每日释放
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- // try {
- // Db::startTrans();
- // UserPointPlan::checkFail();//每日释放
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- try {
- Db::startTrans();
- CashTradeOrder::getBack();//挂出结束退回
- Db::commit();
- } catch (\Exception $e) {
- Db::rollback();
- }
- // try {
- // Db::startTrans();
- // UserMiningMachine::dayMining();//每日挖矿
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- // try {
- // Db::startTrans();
- // UserManageMoney::daySend();
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- // try {
- // Db::startTrans();
- // UserBorrowMoney::daySend();
- // Db::commit();
- // } catch (\Exception $e) {
- // Db::rollback();
- // }
- }
- /**
- * 60秒钟执行的方法
- */
- public function onTask_60()
- {
- (new CashTradeController())->all_money_redis();
- }
- /**
- * 180秒钟执行的方法
- */
- public function onTask_180()
- {
- }
- /**
- * 300秒钟执行的方法
- */
- public function onTask_300()
- {
- UserToken::delToken();//删除一天前的过期token
- SystemAttachment::emptyYesterdayAttachment();//清除昨日海报
- StoreOrder::sendTen();//10分钟未付款发送通知
- }
- }
|