date = $date; $this->channelUid = $channelUid; } /** * Execute the job. * * @return void */ public function handle() { $date = Carbon::parse($this->date)->toDateString(); if (is_null($this->channelUid)) { // 统计全部. $result = self::runJob($date); } else { // 统计渠道 $result = self::runJob($date, $this->channelUid); } } /** * 执行统计. * @param string $date 日期 * @param null $channelUid 渠道UID * @return bool */ protected function runJob($date, $channelUid = null) { $this->getRepo()->rootJob($date, $channelUid); // Todo. self::notify(); return true; } /** * 发送通知, 重新读取数据然后拼接数据,发送邮箱或者tg. */ private function notify() { // Todo 发送通知, 重新读取数据然后拼接数据,发送邮箱或者tg. } /** * 获取属性统计仓库. * @return StatisticsAgentAttrsRepository */ private function getRepo() { if (!$this->repo instanceof StatisticsAgentAttrsRepository) { $this->repo = new StatisticsAgentAttrsRepository(); } return $this->repo; } }