浏览代码

时间格式

lizhen_gitee 9 月之前
父节点
当前提交
fde56595a3
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      application/api/controller/Index.php

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

@@ -38,7 +38,7 @@ class Index extends Api
         $message = $this->info_lang($message,['title','info']);
         $message = info_domain_image($message,['avatar']);
         if($message){
-            $message['createtime'] = date('Y-m-d',$message['sendtime']);
+            $message['createtime'] = $this->date_lang($message['sendtime']);
         }
 
         //留个好评
@@ -129,7 +129,11 @@ class Index extends Api
             $slot['coach_text'] = substr($coach_text,0,-1);
 
             //组织时间
-            $slot['slot_time'] = date('m月d日',$slot['starttime']).'(周'.date('N',$slot['starttime']).')'.','.date('H:i',$slot['starttime']).'-'.date('H:i',$slot['endtime']);
+            if($this->lang == 'en'){
+                $slot['slot_time'] = date('M d',$slot['starttime']).'('.date('D',$slot['starttime']).')'.','.date('H:i',$slot['starttime']).'-'.date('H:i',$slot['endtime']);
+            }else{
+                $slot['slot_time'] = date('n月d',$slot['starttime']).'(周'.date('N',$slot['starttime']).')'.','.date('H:i',$slot['starttime']).'-'.date('H:i',$slot['endtime']);
+            }
         }
 
         $this->success(1,$list);