setName('syncGoodsToEs')->setDescription('同步商品数据到ES'); $this->addArgument("type"); $this->addArgument("goods_id"); $this->addArgument("store_id"); } protected function execute(Input $input, Output $output) { $type = $input->getArgument("type"); $goods_id = $input->getArgument("goods_id"); $store_id = $input->getArgument("store_id"); $goodsCateService = new GoodsCateEs(); // $goodsCateService->batchDelete([345865,1040929]); // exit(); if ($type == "goods") { $goodsCateService->batchCreateGoods($goods_id, $store_id); } elseif ($type == "goods_cate"){ //$goodsCateService->createGoodsCateIndex(); $goodsCateService->batchCreateGoodsCategory($goods_id, $store_id); } } }