* 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); } }