argument('cmd'); $args = $this->arguments(); unset($args['command'], $args['cmd']); $params = array_values($args); if (empty($cmd)) { echo 'Nothing to do...'; } else { if (method_exists($this, $cmd)) { call_user_func_array([$this, $cmd], $params); } else { echo 'cmd not exists'; } } return; } public function time() { $cartesianProduct = new CartesianProduct(); $cartesianProduct->appendSet(["红色", "白色"]); dump($cartesianProduct->compute()); } public function search() { Goods::chunk(100, function ($goods) { $goods->each(function (Goods $g) { app(GoodsService::class)->createIndex($g); }); }); } }