35 lines
910 B
PHP
35 lines
910 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
class NewBuildingController extends BaseController {
|
||
|
|
public $model = null;
|
||
|
|
public function __construct() {
|
||
|
|
$this->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']);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|