Files
CompanyProject/金壶/ydyd_service/application/api/controller/AreaController.php
2024-09-27 01:32:49 +08:00

78 lines
2.1 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
/**
* Created by PhpStorm && wx_lql
* Welfares.php in Project yifu => 文件描述
* 2019/8/7 11:05
*
*  ┏┓  ┏┓+ +
* ┏┛┻━━━┛┻┓ + +
* ┃       ┃  
* ┃   ━   ┃ ++ + + +
*
* ████━████ ┃+
* ┃       ┃ +
* ┃   ┻   ┃
* ┃       ┃ + +
* ┗━┓   ┏━┛
*   ┃   ┃           
*   ┃   ┃ + + + +
*   ┃   ┃
*   ┃   ┃ + 神兽保佑
*   ┃   ┃ 代码无bug  
*   ┃   ┃  +         
*   ┃    ┗━━━┓ + +
*   ┃      ┣┓
*   ┃      ┏┛
*   ┗┓┓┏━┳┓┏┛ + + + +
*    ┃┫┫ ┃┫┫
*   ┗┻┛ ┗┻┛+ + + +
*/
namespace app\api\controller;
use app\common\model\AreaModel;
use think\Exception;
class AreaController extends ApiController
{
/**
* 不需要鉴权方法
* index、save不需要鉴权
* ['index','save']
* 所有方法都不需要鉴权
* [*]
*/
protected $noAuth = ['index'];
/**
* @apiVersion 1.0.0
* @api {get} /area/index 地址列表(朱晓伟)
* @apiName index
* @apiGroup Version
* @apiSuccessExample Success-Response:
* {
* "code": 200,
* "message": "成功",
* "data": {
* "version": 1.0.1,
* "url": "http://www.baidu.com",
* "describe": "有重大更新啦!!",
* "update_method": 0,// 更新方式0:普通更新1、强制更新
* }
* }
* @apiErrorExample Error-Response:
* {
* "code": 200,
* "message": "无更新",
* "data": {}
* }
*/
public function index()
{
$field = 'id, area_name, parent_area_id';
$areaTree = AreaModel::with(['childs','childs.childs'])
->field($field)->where('parent_area_id',0)->all()->toArray();
return self::returnMsg(self::SUCCESS, '无更新',$areaTree);
}
}