You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
817 B

<?php
namespace app\api\controller;
use app\common\controller\Api;
/**
* 首页接口
*/
class Page extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
protected $page = null;
public function _initialize()
{
parent::_initialize();
$this->page = new \app\admin\model\Page;
}
/**
* get portfolio list
*
*/
public function getPage()
{
$title = (string)$this->request->request('title',0);
if(!$title){
$this->error('Parameter error');
}
$where = [];
$where['title'] = $title;
$info = $this->page->where($where)->find();
if(!$info){
$this->error('News does not exist');
}
$this->success('Request succeeded',$info);
}
}