ctms/ctms-api/controllers/gm/v1/CityController.php
fm453 4b842ebf3d ADD:添加后台管理端接口;
DEL:删除不必要的头部注释;
FIX:修正若干已知错误;
2025-06-30 09:40:13 +08:00

52 lines
1.1 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace api\controllers\gm\v1;
use Yii;
class CityController extends Common
{
//主界面
public function beforeAction($action)
{
if (!$this->pid) {
$this->result('您正使用本系统内部接口,禁止非法链接使用!');
}
return parent::beforeAction($action);
}
//主界面
public function actionIndex()
{
$apis = [
'list'=>'城市列表',
];
$this->result('您正使用CMTS-GM系统车主管理接口', $apis, 200);
}
public function actionList()
{
$s = $this->search();
$res = $s['res'];
if (!$res) {
$this->result('没有查询到相应的数据!', [], 0);
}
$return = [];
$return['code'] = 200;
$return['msg'] = '查询成功!';
$return['data']= [
'total'=>count($res),
'citys' => $res,
'page'=>$this->page
];
$this->result($return['msg'], $return['data'], $return['code']);
}
private function search(){
$citys = Yii::$app->params['citys'];
return ['res'=>$citys];
}
}