作者 何书鹏
1 个管道 的构建 通过 耗费 0 秒

bug修改

... ... @@ -63,7 +63,8 @@ class Index extends Api
->order('exam_time asc')
->select();
foreach ($exam_list as &$v) {
$v['countdown'] = ceil(($v['exam_time']-time())/86400);
$countdown = ceil(($v['exam_time']-time())/86400);
$v['countdown'] = $countdown > 0 ? $countdown : 0;
}
$exam = $exam_list[0];
}else{
... ... @@ -71,7 +72,8 @@ class Index extends Api
$exam = Exam::field('id,name,nickname,exam_time')
->order('exam_time asc')
->find();
$exam['countdown'] = ceil(($exam['exam_time']-time())/86400);
$countdown = ceil(($exam['exam_time']-time())/86400);
$exam['countdown'] = $countdown > 0 ? $countdown : 0;
}
// 轮播图
$banner_list = IndexBanner::order('createtime desc')->field('id,image,url')->select();
... ...