52 lines
1.3 KiB
PHP
Raw Normal View History

2025-05-20 16:33:23 +08:00
<?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 = "条数")
* @ApiParams(name = "status", type = "string",required=true,description = "放置类型:1=顶部,2=服务青年专栏")
2025-05-20 16:33:23 +08:00
* @ApiReturn({
*
*})
*/
public function images()
{
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$params=[];
$page = $this->request->get('page/d', 0); //页数
$limit = $this->request->get('limit/d', 0); //条数
$params["status"] = $this->request->get('status/s', ""); //条数
2025-05-20 16:33:23 +08:00
try{
//当前申请状态
$res = Images::allList($page, $limit,$params);
2025-05-20 16:33:23 +08:00
}catch (\Exception $e){
$this->error($e->getMessage());
}
$this->success('查询成功', $res);
}
}