setDescription('Insert mq test feeds'); } public function handle() { $this->line('Insert MQ test feeds now...', 'info'); // shopee // $company_id = 171; // $platform_id = 25; // $store_id = 255; // Tmall $company_id = 188; $platform_id = 2; $store_id = 292; for ($i=0; $i < 2; $i++) { $unique_id = \uniqid(); // 构建 $message_id 格式为 {prefix}#{app_id}#{company_id}#{platform_id}#{store_id}#{entity_type}#{unique_id} $data = Db::connection('raw')->table('wpic_taobao_order') ->select(['id', 'order_raw'])->orderBy('t_created', 'asc') ->limit(20)->offset($i * 20) ->get()->toArray(); $data = [ 'platform_id' => $platform_id, 'company_id' => $company_id, 'store_id' => $store_id, 'unique_id' => $unique_id, 'raw_data' => $data, ]; $message = new TmallOrderProducer($data); $result = $this->producerService->produce($message, true); $log = \sprintf('%s %s %s %s %s', $company_id, $platform_id, $store_id, $unique_id, $result ); dump($log); } } }