Joywork/constructor/Controllers/NewBuildingController.php

35 lines
910 B
PHP
Raw Permalink Normal View History

2026-05-22 20:21:54 +02:00
<?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']);
}
}
}