ctms/ctms-api/controllers/gm/v1/CityController.php
fm453 314745edf8 优化ctms-api语法、修复已知BUG;
主要修复ctms-api、dacms对PHP新版本的支持问题
2025-04-10 23:19:15 +08:00

40 lines
884 B
PHP
Executable File

<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-22T07:30:47+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2024-08-09T09:17:33+08:00
# @Copyright: www.hiluker.cn
namespace api\controllers\gm\v1;
use Yii;
use yii\data\Pagination;
use yii\helpers\Url;
// use backend\models\Citys;
class CityController extends Common
{
//主界面
public function actionIndex()
{
return $this->render('../layouts/dev', []);
}
public function actionSelect()
{
$citys = Yii::$app->params['citys'];
$pager = new Pagination(['totalCount' => count($citys), 'pageSize' => '100']);
$callback = isset($_GET['callback']) ? $_GET['callback'] : 'city';
$search = [];
return $this->render('select', [
'citys' => $citys,
'pager' => $pager,
'search' => $search,
'callback' => $callback
]);
}
}