model = new NewBuildingModel(); } public function complexAll() { // die('test'); // global $agent; $complexes = $this->model->getAll(); return $this->response($complexes); } public function getNewBuildingBlock($params) { $query = (array) $this->query; $result = $this->model->getNewBuildingBlock($params, $query); if ($result) { return $this->response($result); } else { return $this->response(['message' => 'error']); } } public function getNewBuildingBlocks($params) { $current_page = $_GET['page']; $result = $this->model->getNewBuildingBlocks($params, $current_page); if ($result) { return $this->response($result); } else { return $this->response(['message' => 'error']); } } }