...
|
...
|
@@ -37,14 +37,19 @@ class Index extends Api |
|
|
"id": 3, //ID
|
|
|
"name": "", //考试名称
|
|
|
"nickname": "", //昵称
|
|
|
"countdown": 26 //考试倒计时
|
|
|
"countdown": 26 //距离考试倒计时天数
|
|
|
}],
|
|
|
"banner_list": [{ //轮播图列表
|
|
|
"id": 1, //ID
|
|
|
"image": "https://img02.mockplus.cn/idoc/sketch/2020-08-06/006324c3-e5d3-4206-be48-52a7c7468e74.7C1FC40C-CED5-4B08-9506-3E48A2732B2C.png", //图片地址
|
|
|
"link": "https://img02.mockplus.cn/idoc/sketch/2020-08-06/006324c3-e5d3-4206-be48-52a7c7468e74.7C1FC40C-CED5-4B08-9506-3E48A2732B2C.png" //链接地址
|
|
|
}],
|
|
|
"countdown": 26, //距离考试倒计时天数
|
|
|
"exam": {
|
|
|
"id": 3, //ID
|
|
|
"name": "", //考试名称
|
|
|
"nickname": "", //昵称
|
|
|
"countdown": 26 //距离考试倒计时天数
|
|
|
},
|
|
|
"news_list": [{ //报考资讯列表
|
|
|
"id": 1, //资讯ID
|
|
|
"cover": "", //封面图
|
...
|
...
|
@@ -70,18 +75,19 @@ class Index extends Api |
|
|
$exam = $exam_list[0];
|
|
|
}else{
|
|
|
$exam_list = [];
|
|
|
$exam = Exam::order('exam_time asc')->find();
|
|
|
$exam = Exam::field('id,name,nickname,exam_time')
|
|
|
->order('exam_time asc')
|
|
|
->find();
|
|
|
$exam['countdown'] = ceil(($exam['exam_time']-time())/86400);
|
|
|
}
|
|
|
// 轮播图
|
|
|
$banner_list = IndexBanner::order('createtime desc')->field('id,image,url')->select();
|
|
|
// 距离考试倒计时天数
|
|
|
$countdown = ceil(($exam['exam_time']-time())/86400);
|
|
|
// 报考资讯
|
|
|
$news_list = News::order('createtime desc')->select();
|
|
|
foreach ($news_list as $value) {
|
|
|
$value->visible(['id','cover','title','read_num','createtime']);
|
|
|
}
|
|
|
$this->success('成功',compact('exam_list','banner_list','countdown','news_list'));
|
|
|
$this->success('成功',compact('exam_list','banner_list','exam','news_list'));
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|