getMessage()); } try { $start_time = time(); LalaPinkJoin::autoPink();//自动拼团 $end_time = time(); @file_put_contents('autoPinkTime.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); } catch (\Exception $e) { Log::error('autoPink:' . $e->getMessage()); } 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(); } } /** * 60秒钟执行的方法 */ public function onTask_60() { try { $start_time = time(); LalaPinkJoin::sendMoney();//自动拼团 $end_time = time(); @file_put_contents('sendMoneyTime.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); } catch (\Exception $e) { Log::error('sendMoney:' . $e->getMessage()); } try { $start_time = time(); $res = UserMiningMachine::dayMining();//每日挖矿 $end_time = time(); @file_put_contents('dayMiningTime.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); if (!$res) { @file_put_contents('mining.txt', '【' . date('Y-m-d H:i:s') . '】' . UserMiningMachine::getErrorInfo() . PHP_EOL, FILE_APPEND); } } catch (\Exception $e) { @file_put_contents('mining.txt', '【' . date('Y-m-d H:i:s') . '】' . $e->getMessage() . PHP_EOL, FILE_APPEND); } try { $start_time = time(); UserPointPlan::day_release();//每日释放 $end_time = time(); @file_put_contents('dayReleaseTime.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); } catch (\Exception $e) { Log::error('day_release:' . $e->getMessage()); } try { $start_time = time(); UserPointPlan::day_release_ticket();//每日释放 $end_time = time(); @file_put_contents('dayReleaseTicketTime.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); } catch (\Exception $e) { Log::error('day_release_ticket:' . $e->getMessage()); } } /** * 180秒钟执行的方法 */ public function onTask_180() { } /** * 300秒钟执行的方法 */ public function onTask_300() { try { UserToken::startTrans(); $start_time = time(); UserToken::delToken(); $end_time = time(); @file_put_contents('delTokenTime.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); UserToken::commit(); } catch (\Exception $e) { Log::error('delToken:' . $e->getMessage()); UserToken::rollback(); } try { BaseModel::beginTrans(); $start_time = time(); $res = StoreOrder::sendProductReturn(); $end_time = time(); @file_put_contents('sendProductReturn.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); BaseModel::checkTrans($res); if (!$res) { Log::error('sendProductReturn:' . StoreOrder::getErrorInfo()); } } catch (\Exception $e) { Log::error('sendProductReturn:' . $e->getMessage()); BaseModel::rollbackTrans(); } try { BaseModel::beginTrans(); $start_time = time(); $res = UserRecharge::sendReturn(); $end_time = time(); @file_put_contents('sendRechargeReturn.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); BaseModel::checkTrans($res); if (!$res) { Log::error('sendRechargeReturn:' . UserRecharge::getErrorInfo()); } } catch (\Exception $e) { Log::error('sendRechargeReturn:' . $e->getMessage()); BaseModel::rollbackTrans(); } try { BaseModel::beginTrans(); $start_time = time(); $res = StoreOrder::returnAreaPrice(); $end_time = time(); @file_put_contents('returnAreaPrice.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); BaseModel::checkTrans($res); if (!$res) { Log::error('returnAreaPrice:' . StoreOrder::getErrorInfo()); } } catch (\Exception $e) { Log::error('returnAreaPrice:' . $e->getMessage()); BaseModel::rollbackTrans(); } try { BaseModel::beginTrans(); $start_time = time(); $res = StoreOrder::returnPartnerPrice(); $end_time = time(); @file_put_contents('returnPartnerPrice.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); BaseModel::checkTrans($res); if (!$res) { Log::error('returnPartnerPrice:' . StoreOrder::getErrorInfo()); } } catch (\Exception $e) { Log::error('returnPartnerPrice:' . $e->getMessage()); BaseModel::rollbackTrans(); } SystemAttachment::emptyYesterdayAttachment();//清除昨日海报 StoreOrder::sendTen();//10分钟未付款发送通知 // $start_time = time(); // BlockChianService::autoGetTransfer(); // $end_time = time(); // @file_put_contents('autoGetTransferTime.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); // $start_time = time(); // BlockChianService::autoCheckTransfer(); // $end_time = time(); // @file_put_contents('autoCheckTransferTime.txt', '【' . date('Y-m-d H:i:s') . '】' . ($start_time - $end_time) . '秒' . PHP_EOL, FILE_APPEND); } /** * 300秒钟执行的方法 */ public function onTask_7200() { } }