作者 开飞机的舒克

新增活动详情接口

@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace app\api\controller; 3 namespace app\api\controller;
4 4
5 use app\common\controller\Api; 5 use app\common\controller\Api;
  6 +use app\common\model\Active;
6 use app\common\model\Item; 7 use app\common\model\Item;
7 use app\common\model\ItemDetails; 8 use app\common\model\ItemDetails;
8 9
@@ -53,6 +54,28 @@ class Activity extends Api @@ -53,6 +54,28 @@ class Activity extends Api
53 } 54 }
54 55
55 /** 56 /**
  57 + * @ApiTitle (活动详情)
  58 + * @ApiMethod (POST)
  59 + * @ApiParams (name="id", type="interge", required=false, description="活动ID")
  60 + * @ApiReturn ({"code":状态码,
  61 + "msg":"提示信息"
  62 + "time": "时间戳",
  63 + "data": [
  64 + "title": "活动名称",
  65 + "images": "活动图片",
  66 + "depict": "描述",
  67 + ]
  68 + })
  69 + */
  70 + public function activeDetails(){
  71 + $id = $this->request->param('id');
  72 + $model = new Active();
  73 + $data = $model->where('id',$id)->find()->toArray();
  74 + $this->success('',$data);
  75 + }
  76 +
  77 +
  78 + /**
56 * @ApiTitle (届次) 79 * @ApiTitle (届次)
57 * @ApiMethod (POST) 80 * @ApiMethod (POST)
58 * @ApiParams (name="id", type="interge", required=true, description="活动id") 81 * @ApiParams (name="id", type="interge", required=true, description="活动id")
  1 +<?php
  2 +
  3 +namespace app\common\model;
  4 +
  5 +use think\Model;
  6 +
  7 +class Active extends Model
  8 +{
  9 +
  10 + // 表名
  11 + protected $name = 'activity';
  12 + // 自动写入时间戳字段
  13 + protected $autoWriteTimestamp = 'int';
  14 + // 定义时间戳字段名
  15 + protected $createTime = 'createtime';
  16 + protected $updateTime = 'updatetime';
  17 + // 追加属性
  18 + protected $append = [
  19 + ];
  20 +
  21 +
  22 +}
此 diff 太大无法显示。