作者 开飞机的舒克

新增活动详情接口

... ... @@ -3,6 +3,7 @@
namespace app\api\controller;
use app\common\controller\Api;
use app\common\model\Active;
use app\common\model\Item;
use app\common\model\ItemDetails;
... ... @@ -53,6 +54,28 @@ class Activity extends Api
}
/**
* @ApiTitle (活动详情)
* @ApiMethod (POST)
* @ApiParams (name="id", type="interge", required=false, description="活动ID")
* @ApiReturn ({"code":状态码,
"msg":"提示信息"
"time": "时间戳",
"data": [
"title": "活动名称",
"images": "活动图片",
"depict": "描述",
]
})
*/
public function activeDetails(){
$id = $this->request->param('id');
$model = new Active();
$data = $model->where('id',$id)->find()->toArray();
$this->success('',$data);
}
/**
* @ApiTitle (届次)
* @ApiMethod (POST)
* @ApiParams (name="id", type="interge", required=true, description="活动id")
... ...
<?php
namespace app\common\model;
use think\Model;
class Active extends Model
{
// 表名
protected $name = 'activity';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
];
}
\ No newline at end of file
... ...
此 diff 太大无法显示。