|
@@ -67,18 +67,17 @@ class Index extends Api
|
|
|
foreach($lists as $key => &$val){
|
|
|
$val['logo_image'] = localpath_to_netpath($val['logo_image']);
|
|
|
|
|
|
- if($now < $val['starttime']){
|
|
|
+ if(/*$val['endtime'] < $now || */$val['pingjia_uid'] != 0){ //时间或评价,都行
|
|
|
+ $val['show_status'] = 3;
|
|
|
+ $val['show_status_text'] = '已结束';
|
|
|
+ }elseif($now < $val['starttime']){
|
|
|
$val['show_status'] = 1;
|
|
|
$val['show_status_text'] = '待开始';
|
|
|
- }
|
|
|
- if($val['starttime'] < $now && $now < $val['endtime']){
|
|
|
+ }else{
|
|
|
$val['show_status'] = 2;
|
|
|
$val['show_status_text'] = '进行中';
|
|
|
}
|
|
|
- if(/*$val['endtime'] < $now || */$val['pingjia_uid'] != 0){ //时间或评价,都行
|
|
|
- $val['show_status'] = 3;
|
|
|
- $val['show_status_text'] = '已结束';
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
$this->success('', $lists);
|
|
@@ -86,6 +85,7 @@ class Index extends Api
|
|
|
|
|
|
//考试,更多,所有考试列表
|
|
|
public function all_paper_list(){
|
|
|
+ if($this->auth->idcard_status != 1){$this->success(1,[]);}
|
|
|
|
|
|
$papers = Db::name('exam_paper')->field('id,image,title,start_time,end_time,total_score,limit_time')
|
|
|
->where('status', 'NORMAL')
|
|
@@ -103,20 +103,20 @@ class Index extends Api
|
|
|
|
|
|
//培训,更多,所有培训列表
|
|
|
public function all_trainactive_list(){
|
|
|
+
|
|
|
$type = input('type',1);
|
|
|
$now = time();
|
|
|
|
|
|
$where = [];
|
|
|
- if($type == 1){
|
|
|
- $where['starttime'] = ['gt',$now];
|
|
|
- }
|
|
|
- if($type == 2){
|
|
|
- $where['starttime'] = ['lt',$now];
|
|
|
- $where['endtime'] = ['gt',$now];
|
|
|
- }
|
|
|
+
|
|
|
if($type == 3){
|
|
|
// $where = 'endtime < '.$now.' or pingjia_time > 0';
|
|
|
$where['pingjia_uid'] = ['NEQ',0];
|
|
|
+ }elseif($type == 1){
|
|
|
+ $where['starttime'] = ['gt',$now];
|
|
|
+ }else{
|
|
|
+ $where['starttime'] = ['lt',$now];
|
|
|
+ $where['endtime'] = ['gt',$now];
|
|
|
}
|
|
|
|
|
|
$papers = Db::name('train_active')->field('id,title,logo_image,starttime,endtime,pingjia_time,pingjia_uid')
|
|
@@ -130,18 +130,17 @@ class Index extends Api
|
|
|
foreach($papers as $key => &$val){
|
|
|
$val['logo_image'] = localpath_to_netpath($val['logo_image']);
|
|
|
|
|
|
- if($now < $val['starttime']){
|
|
|
+ if(/*$val['endtime'] < $now || */$val['pingjia_uid'] != 0){ //时间或评价,都行
|
|
|
+ $val['show_status'] = 3;
|
|
|
+ $val['show_status_text'] = '已结束';
|
|
|
+ }elseif($now < $val['starttime']){
|
|
|
$val['show_status'] = 1;
|
|
|
$val['show_status_text'] = '待开始';
|
|
|
- }
|
|
|
- if($val['starttime'] < $now && $now < $val['endtime']){
|
|
|
+ }else{
|
|
|
$val['show_status'] = 2;
|
|
|
$val['show_status_text'] = '进行中';
|
|
|
}
|
|
|
- if(/*$val['endtime'] < $now || */$val['pingjia_uid'] != 0){ //时间或评价,都行
|
|
|
- $val['show_status'] = 3;
|
|
|
- $val['show_status_text'] = '已结束';
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
$this->success(1, $papers);
|