Files
shopxo/application/api/controller/Region.php

71 lines
1.8 KiB
PHP
Raw Normal View History

2018-12-28 18:58:37 +08:00
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
2019-02-18 13:52:07 +08:00
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
2018-12-28 18:58:37 +08:00
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\api\controller;
2021-01-06 21:26:19 +08:00
use app\service\BaseService;
use app\service\RegionService;
2018-12-28 18:58:37 +08:00
/**
* 地区
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Region extends Common
{
/**
* [__construct 构造方法]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
}
/**
2020-12-29 11:52:23 +08:00
* 获取地区节点
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-12-29
* @desc description
2018-12-28 18:58:37 +08:00
*/
public function Index()
{
// 获取地区
$params = [
'where' => [
'pid' => isset($this->data_post['pid']) ? intval($this->data_post['pid']) : 0,
],
];
2021-01-06 21:26:19 +08:00
$result = RegionService::RegionNode($params);
return BaseService::DataReturn($result);
2018-12-28 18:58:37 +08:00
}
2020-12-29 11:52:23 +08:00
/**
* 获取地区所有数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-12-29
* @desc description
*/
public function All()
{
return RegionService::RegionAll();
}
2018-12-28 18:58:37 +08:00
}
?>