作者 开飞机的舒克

大屏接口优化

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