✨ 增加获取图片的接口
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by WispX.
|
||||
* User: WispX <1591788658@qq.com>
|
||||
* Date: 2019/10/31
|
||||
* Time: 11:10 上午
|
||||
* Link: https://github.com/wisp-x
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\model\Images;
|
||||
|
||||
class Image extends Base
|
||||
{
|
||||
private $model;
|
||||
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
$this->model = new Images();
|
||||
$this->model = $this->model->where('user_id', $this->user->id);
|
||||
}
|
||||
|
||||
public function find()
|
||||
{
|
||||
$id = $this->param('id');
|
||||
$image = $this->model->where(['id' => $id])->find();
|
||||
$this->response('success', $image);
|
||||
}
|
||||
|
||||
public function items()
|
||||
{
|
||||
$page = $this->param('page', 1);
|
||||
$rows = $this->param('rows', 20);
|
||||
$images = $this->model->paginate(null, false, [
|
||||
'page' => $page,
|
||||
'list_rows' => $rows,
|
||||
]);
|
||||
$this->response('success', $images);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user