50 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace app\api\controller;
 | 
						|
 | 
						|
use app\api\controller\home\Base;
 | 
						|
use app\common\controller\Api;
 | 
						|
use app\common\model\home\Images;
 | 
						|
 | 
						|
/**
 | 
						|
 * 首页接口
 | 
						|
 */
 | 
						|
class Index extends Base
 | 
						|
{
 | 
						|
    protected $noNeedLogin = ['*'];
 | 
						|
    protected $noNeedRight = ['*'];
 | 
						|
 | 
						|
 | 
						|
 | 
						|
    /**
 | 
						|
     * @ApiTitle( 首页轮播图)
 | 
						|
     * @ApiSummary(首页轮播图)
 | 
						|
     * @ApiMethod(GET)
 | 
						|
     * @ApiParams(name = "page", type = "string",required=true,description = "页数")
 | 
						|
     * @ApiParams(name = "limit", type = "string",required=true,description = "条数")
 | 
						|
     * @ApiReturn({
 | 
						|
     *
 | 
						|
     *})
 | 
						|
     */
 | 
						|
    public function images()
 | 
						|
    {
 | 
						|
        $user_id = 0;
 | 
						|
        $user = $this->auth->getUser();//登录用户
 | 
						|
        if($user)$user_id = $user['id'];
 | 
						|
 | 
						|
        $page      =  $this->request->get('page/d', 0); //页数
 | 
						|
        $limit   =  $this->request->get('limit/d', 0); //条数
 | 
						|
 | 
						|
 | 
						|
        try{
 | 
						|
            //当前申请状态
 | 
						|
            $res =  Images::allList($page, $limit);
 | 
						|
 | 
						|
        }catch (\Exception $e){
 | 
						|
 | 
						|
            $this->error($e->getMessage());
 | 
						|
        }
 | 
						|
        $this->success('查询成功', $res);
 | 
						|
    }
 | 
						|
}
 |