setDescription('推送统计数据到tg群'); $this->addArgument('date', InputArgument::OPTIONAL, '日期', ''); } public function handle() { $date = $this->input->getArgument('date'); if (empty($date)) { // 定义昨天 $date = Carbon::now()->subDays(1)->toDateString(); } else { $date = Carbon::parse($date)->toDateString(); } /** * @var StatisticsRepository $repo */ $repo = make(StatisticsRepository::class); $data = $repo->oneDayInfo($date); $vipMoney = $data['all_money'] - $data['coins_money']; /** * @var TelegramRepository $tgRepo */ $tgRepo = make(TelegramRepository::class); $taskName = 'data_report'; $nowDate = Carbon::now()->toDateTimeString(); $appFlag = env('APP_NAME', ''); $msgContent = <<sendCommonText($msgContent, $taskName); $this->info('success'); } }