125 lines
3.7 KiB
PHP
125 lines
3.7 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\api\controller\home\Base;
|
|
use app\common\controller\Api;
|
|
use app\common\model\home\AboutUs;
|
|
use app\common\model\home\FriendshipLink;
|
|
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=服务青年专栏")
|
|
* @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', ""); //条数
|
|
|
|
|
|
try{
|
|
//当前申请状态
|
|
$res = Images::allList($page, $limit,$params);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->error($e->getMessage());
|
|
}
|
|
$this->success('查询成功', $res);
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* @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=各地共青团网站,3=其他,4=办公入口")
|
|
* @ApiReturn({
|
|
*
|
|
*})
|
|
*/
|
|
public function friendship_link()
|
|
{
|
|
$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', ""); //条数
|
|
|
|
|
|
try{
|
|
//当前申请状态
|
|
$res = FriendshipLink::allList($page, $limit,$params);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->error($e->getMessage());
|
|
}
|
|
$this->success('查询成功', $res);
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* @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=false,description = "介绍类型:1=领导班子,2=机构职能,3=部门设置,4=直属单位,5=下属部门")
|
|
* @ApiReturn({
|
|
*
|
|
*})
|
|
*/
|
|
public function about_us()
|
|
{
|
|
$user_id = 0;
|
|
$user = $this->auth->getUser();//登录用户
|
|
if($user)$user_id = $user['id'];
|
|
$params=[];
|
|
$page = $this->request->get('page/d', 1); //页数
|
|
$limit = $this->request->get('limit/d', 100); //条数
|
|
$params["status"] = $this->request->get('status/s', ""); //条数
|
|
|
|
|
|
try{
|
|
//当前申请状态
|
|
$res = AboutUs::allList($page, $limit,$params);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->error($e->getMessage());
|
|
}
|
|
$this->success('查询成功', $res);
|
|
}
|
|
}
|