Browse Source

各种列表

lizhen_gitee 6 tháng trước cách đây
mục cha
commit
89d9145eab

+ 6 - 5
application/api/controller/Index.php

@@ -55,7 +55,7 @@ class Index extends Api
     public function index_trainactive(){
         $now    = time();
 
-        $lists = Db::name('train_active')->field('id,title,logo_image,starttime,endtime,pingjia_time')
+        $lists = Db::name('train_active')->field('id,title,logo_image,starttime,endtime,pingjia_time,pingjia_uid')
             ->where('status', 1)
             ->where('deletetime', NULL)
             ->whereRaw("((endtime = 0) or (endtime > {$now}))")
@@ -75,7 +75,7 @@ class Index extends Api
                 $val['show_status'] = 2;
                 $val['show_status_text'] = '进行中';
             }
-            if($val['endtime'] < $now || $val['pingjia_time'] > 0){ //时间或评价,都行
+            if(/*$val['endtime'] < $now || */$val['pingjia_uid'] != 0){ //时间或评价,都行
                 $val['show_status'] = 3;
                 $val['show_status_text'] = '已结束';
             }
@@ -115,10 +115,11 @@ class Index extends Api
             $where['endtime'] = ['gt',$now];
         }
         if($type == 3){
-            $where = 'endtime < '.$now.' or pingjia_time > 0';
+//            $where = 'endtime < '.$now.' or pingjia_time > 0';
+            $where['pingjia_uid'] = ['NEQ',0];
         }
 
-        $papers = Db::name('train_active')->field('id,title,logo_image,starttime,endtime,pingjia_time')
+        $papers = Db::name('train_active')->field('id,title,logo_image,starttime,endtime,pingjia_time,pingjia_uid')
             ->where('status', 1)
             ->where('deletetime', NULL)
             ->where($where)
@@ -137,7 +138,7 @@ class Index extends Api
                 $val['show_status'] = 2;
                 $val['show_status_text'] = '进行中';
             }
-            if($val['endtime'] < $now || $val['pingjia_time'] > 0){ //时间或评价,都行
+            if(/*$val['endtime'] < $now || */$val['pingjia_uid'] != 0){ //时间或评价,都行
                 $val['show_status'] = 3;
                 $val['show_status_text'] = '已结束';
             }

+ 3 - 3
application/api/controller/Trainactive.php

@@ -20,7 +20,7 @@ class Trainactive extends Api
         $now  = time();
 
 
-        $papers = Db::name('train_active')->field('id,title,logo_image,starttime,endtime,pingjia_time')
+        $papers = Db::name('train_active')->field('id,title,logo_image,starttime,endtime,pingjia_time,pingjia_uid')
             ->where('status', 1)
             ->where('deletetime', NULL)
             ->where("(userauth_status = 1) or (find_in_set('".$this->auth->id."',user_ids) )")
@@ -39,7 +39,7 @@ class Trainactive extends Api
                 $val['show_status'] = 2;
                 $val['show_status_text'] = '进行中';
             }
-            if($val['endtime'] < $now || $val['pingjia_time'] > 0){ //时间或评价,都行
+            if(/*$val['endtime'] < $now || */$val['pingjia_uid'] != 0){ //时间或评价,都行
                 $val['show_status'] = 3;
                 $val['show_status_text'] = '已结束';
             }
@@ -72,7 +72,7 @@ class Trainactive extends Api
                 $info['show_status'] = 2;
                 $info['show_status_text'] = '进行中';
             }
-            if($info['endtime'] < $now || $info['pingjia_time'] > 0){ //时间或评价,都行
+            if(/*$info['endtime'] < $now || */$info['pingjia_uid'] != 0){ //时间或评价,都行
                 $info['show_status'] = 3;
                 $info['show_status_text'] = '已结束';
             }