作者 开飞机的舒克

新增活动详情接口

... ... @@ -5,7 +5,6 @@ namespace app\api\controller;
use app\common\controller\Api;
use app\common\model\Active;
use app\common\model\Item;
use app\common\model\ItemDetails;
/**
* 活动接口
... ... @@ -19,7 +18,6 @@ class Activity extends Api
/**
* @ApiTitle (活动首页)
* @ApiMethod (POST)
* @ApiParams (name="row", type="string", required=false, description="每页显示行数[非必填]")
* @ApiParams (name="page", type="string", required=false, description="当前页[非必填]")
* @ApiReturn ({"code":状态码,
"msg":"提示信息"
... ... @@ -34,13 +32,10 @@ class Activity extends Api
*/
public function index()
{
$row = $this->request->param('row');
$page = $this->request->param('page');
$row = $row ? $row : 10;
$page = $page ? $page : 1;
$data = db('activity')
->order('createtime DESC')
->paginate($row,false,['page'=>$page])
->paginate(10,false,['page'=>$page])
->each(function ($item,$key){
$item['images'] = cdnurl($item['image'], true);
$item['createtime'] = date('Y-m-d', $item['createtime']);
... ...
... ... @@ -18,5 +18,8 @@ class Active extends Model
protected $append = [
];
public function getImageAttr($value,$data){
$value = cdnurl($data['image'],true);
return $value;
}
}
\ No newline at end of file
... ...
... ... @@ -2438,12 +2438,6 @@
</thead>
<tbody>
<tr>
<td>row</td>
<td>string</td>
<td></td>
<td>每页显示行数[非必填]</td>
</tr>
<tr>
<td>page</td>
<td>string</td>
<td></td>
... ... @@ -2472,10 +2466,6 @@
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/activity/index" method="POST" name="form0" id="form0">
<div class="form-group">
<label class="control-label" for="row">row</label>
<input type="string" class="form-control input-sm" id="row" placeholder="每页显示行数[非必填]" name="row">
</div>
<div class="form-group">
<label class="control-label" for="page">page</label>
<input type="string" class="form-control input-sm" id="page" placeholder="当前页[非必填]" name="page">
</div>
... ... @@ -6340,7 +6330,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-04-12 17:35:22 <a href="./" target="_blank">校园活动</a>
Generated on 2023-04-12 17:40:22 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...