googleOAuthService->getGoogleAdCustomers($options); foreach ($customers as $customer) { if ($customer['login_customer_id'] > 0) { $customer['date'] = $options['date']; Redis::send($queue, $customer, rand(1, 10)); } } //同步消息到同步任务表 // $queueTask = self::task; // $taskInfo = [ // 'ecommerce' => 1001, // 'ecommerce_shop_id' => $options['date'], // 'task_type' => 'InsightsMerge', // 'remain' => 1 // ]; // Client::send($queueTask, $taskInfo, 30); return self::event . ' send queue ok'; } /** * get date datas * @throws ApiException */ public function getDateDatas($customer) { if ($customer['login_customer_id'] > 0 && ((isset($customer['manager']) && $customer['manager'] === false))) { // dump($customer); $googleAdsCampaignService = new googleAdsCampaignService($customer['customer_id']); // dump($customer['customer_id'],$customer, $options['date']); $googleAdsCampaignService->runListDateDatas($customer['customer_id'], $customer, $customer['date']); } // $this->googleAdsCampaignService->runListDateDatas($options['customer_id'], $options['date']); // return $this->successResponse(['data' => $resourceName]); } /** * 通知到同步task * @throws ApiException */ public function noticeDateDatas($taskInfo) { } // 可以加入一些公共方法 protected function successResponse($data): Response { return Json([ 'code' => 0, 'msg' => 'ok', 'data' => $data, ]); } protected function errorResponse($code, $message, $data = []): Response { return Json([ 'code' => $code, 'msg' => $message ?: 'error', 'data' => $data ]); } }