option('con'); $param = $this->option('param'); if(!empty($con)) { switch ($con) { case 'jobs': $id = Arr::get($param,'id',null); if($id) { try{ (new Slack(new Request(['title' => 'TOff-started', 'fields' => ['Appid' => $id], 'group'=>Slack::$STAGE_TESTING])))->send(); $app = ConsumerApplication::with('merchant')->where('id', $id)->first(); if($app->merchant->table_of_offers){ (new Slack(new Request(['title' => 'TOff-running', 'fields' => ['Appid' => $id], 'group'=>Slack::$STAGE_TESTING])))->send(); (new TestingController())->runAutoDecision(new Request(['id' => $id])); }else{ (new Slack(new Request(['title' => 'TOff-skipped', 'fields' => ['Appid' => $id], 'group'=>Slack::$STAGE_TESTING])))->send(); } (new Slack(new Request(['title' => 'TOff-ended', 'fields' => ['Appid' => $id], 'group'=>Slack::$STAGE_TESTING])))->send(); }catch (\Exception $e){ (new Slack(new Request(['title' => 'TOff', 'fields' => ['Message' => $e->getMessage(), 'Line' => $e->getLine(), 'File' =>$e->getFile(), 'Trace' => $e->getTraceAsString()], 'group'=>Slack::$STAGE_TESTING])))->send(); } } else { return Utility::handlerSendFailed([\Config::get("constants.txt.txt_errors") => ['Missing parameter ExecuteJob']]); } break; default: return Utility::handlerSendFailed([\Config::get("constants.txt.txt_errors") => ['No case found to handle in ExecuteJob']]); } } else { return Utility::handlerSendFailed([Config::get("constants.txt.txt_errors") => ['Context is missing']]); } } }