Present.php 953 字节
<?php

namespace app\api\controller;

use think\Db;
use think\Validate;
use app\common\controller\Api;

/**
 * 赠品接口
 */
class Present extends Api
{
    /**
     * @ApiTitle    (获取赠品列表)
     * @ApiSummary  (获取赠品列表)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/present/getPresentList)
     * @ApiHeaders  (name=token, type=string, required=false, description="请求的Token")
     * @ApiReturn({
    "code": 1,
    "msg": "SUCCESS",
    "time": "1553839125",
    "data": [
    {
    "id": 3, 赠品id
    "ch_name": "赠品3",  中文名称
    "en_name": "present3",  英文名称
    "image": "http://q7s0a1rb4.bkt.clouddn.com/uploads/20200420/26f5e51b8ac7fbd6f1c649cc45a18265.png" 缩略图
    },

    ]
    })
     */
    public function getPresentList(){
        $model = new \app\api\model\Present;

        $data = $model->selectData([],null,$this->lang);

        $this->success('SUCCESS',$data);
    }
}