作者 开飞机的舒克

大屏接口优化

... ... @@ -27,19 +27,10 @@ class Screen extends Api
}
*/
public function index(){
$time = time();
$list = [];
$data = db('screen')->find();
$list['images'] = cdnurl($data['images'],true);
if ($data['starttime']<=$time && $data['endtime']>=$time){
$day = intval(($data['endtime']-$time)/86400);
$hour = intval((($data['endtime']-$time)%86400)/3600);
$minute = intval(((($data['endtime']-$time)%86400)%3600)/60);
$second = intval(((($data['endtime']-$time)%86400)%3600)%60);
$list['count_down'] = "距离活动结束还有".$day."天".$hour."时".$minute."分".$second."秒";
}else if ($data['endtime']<=$time){
$list['count_down'] = "距离活动结束还有00天00时00分00秒";
}
$list['count_down'] = $data['endtime'];
$list['screen_name'] = $data['title'];
$list['campus_name'] = db('campus c')
->where('c.id',$data['campus_id'])
... ...
... ... @@ -4973,7 +4973,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-15 16:50:58 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-15 17:26:25 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...