public function loadDealerGroupedByCreditCode($code) { $this->_validate($code, "code"); try { return \Akzo\Dealer::where('credit_code', 'like', $code)->selectRaw("GROUP_CONCAT(`ak_sales_dealers`.`id`) `cids`, GROUP_CONCAT(`ak_sales_dealers`.`code`) `ccodes`")->groupBy('credit_code')->get()->first(); } catch (\PDOException $e) { $GLOBALS['logger']->info("Error: " . $e->getMessage()); throw new \InvalidArgumentException(\Akzo\Product\ErrorMessages::PROCESS_ERROR, \Native5\Core\Http\StatusCodes::BAD_REQUEST); } }