Abouts.php 1.4 KB
<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Db;
/**
 * 关于我们接口**
 */
class Abouts extends Api
{
    protected  $noNeedLogin = [];
    protected $noNeedRight = '*';
    public function _initialize()
    {
        parent::_initialize();
    }

    /**
     * @ApiTitle    (关于我们详情)
     * @ApiSummary  (关于我们详情)
     * @ApiMethod   (GET)
     * @ApiRoute    (/api/abouts/aboutDetail)
     * @ApiHeaders  (name=token, type=string, required=true, description="请求的Token")
     * @ApiReturn({
            "code": 1,
            "msg": "成功",
            "time": "1553777266",
            "data": [
                {
                    "id": 1,
                    "title": "如何回收?",//标题
                    "description": "废杂铜的种类繁多,回收利用技术和工艺也有所不同",//详情
                    "image": "/uploads/20190320/4d82786ab0f7866110519f221cbf29a6.jpg"
                }
            ]
          })
     */
    public function aboutDetail(){
        if($this->request->isGet()){
            $data = Db::table('gc_about')
                ->field('id,description,image,lng,lat')
                ->order('id desc')
                ->find();
            $this->success('成功',$data);
        }else{
            $this->error('请求方式错误');
        }
    }
}