54 lines
1.1 KiB
PHP
Executable File
54 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Home\Controller;
|
|
|
|
use Service\ResourcesService;
|
|
|
|
/**
|
|
* 地区
|
|
* @author Devil
|
|
* @blog http://gong.gg/
|
|
* @version 0.0.1
|
|
* @datetime 2016-12-01T21:51:08+0800
|
|
*/
|
|
class RegionController extends CommonController
|
|
{
|
|
/**
|
|
* [_initialize 前置操作-继承公共前置方法]
|
|
* @author Devil
|
|
* @blog http://gong.gg/
|
|
* @version 0.0.1
|
|
* @datetime 2016-12-03T12:39:08+0800
|
|
*/
|
|
public function _initialize()
|
|
{
|
|
// 调用父类前置方法
|
|
parent::_initialize();
|
|
|
|
// 是否ajax请求
|
|
if(!IS_AJAX)
|
|
{
|
|
$this->error(L('common_unauthorized_access'));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 获取地区
|
|
* @author Devil
|
|
* @blog http://gong.gg/
|
|
* @version 1.0.0
|
|
* @date 2018-09-21
|
|
* @desc description
|
|
*/
|
|
public function Index()
|
|
{
|
|
$params = [
|
|
'where' => [
|
|
'pid' => intval(I('pid', 0)),
|
|
],
|
|
];
|
|
$data = ResourcesService::RegionNode($params);
|
|
$this->ajaxReturn(L('common_operation_success'), 0, $data);
|
|
}
|
|
}
|
|
?>
|