lizhen_gitee 9 ماه پیش
والد
کامیت
ca07ce6511

+ 12 - 1
application/api/controller/coach/Lesson.php

@@ -87,6 +87,17 @@ class Lesson extends Apic
             $startday = '01';
         }
 
+        //一周
+        $week_arr = [
+            1 => '周一',
+            2 => '周二',
+            3 => '周三',
+            4 => '周四',
+            5 => '周五',
+            6 => '周六',
+            7 => '周日',
+        ];
+
         //本月结束日
         $endday_arr = [
             '01' => 31,
@@ -131,7 +142,7 @@ class Lesson extends Apic
             $idate = $year.'-'.$month.'-'.$j;
 
             $itime = strtotime($idate);
-            $week = $this->lang == 'en' ? date('D',$itime) : '周'.date('N',$itime);
+            $week = $this->lang == 'en' ? date('D',$itime) : $week_arr[date('N',$itime)];
 
             $i_data = [
                 'yeah' =>$year,

+ 1 - 1
application/api/controller/coach/Video.php

@@ -25,7 +25,7 @@ class Video extends Apic
                     $val['thumb_image'] = $val['video_file'].'?x-oss-process=video/snapshot,t_100,f_png,m_fast';
                 }
 
-                $val['createtime'] = date('Y-m-d H:i:s',$val['createtime']);
+                $val['createtime'] = $this->datetime_lang($val['createtime']);
 
             }
         }

+ 28 - 0
application/common/controller/Apic.php

@@ -194,6 +194,34 @@ class Apic
         return $data;
     }
 
+    //Jun 19,2024
+    //6月19,2024
+    protected function date_lang($time){
+        if($this->lang == 'en'){
+            return date('M d,Y',$time);
+        }else{
+            return date('n月d,Y',$time);
+        }
+    }
+
+    protected function datetime_lang($time){
+        if($this->lang == 'en'){
+            return date('M d,Y H:i',$time);
+        }else{
+            return date('n月d,Y H:i',$time);
+        }
+    }
+
+    //Wed,10:41am
+    //星期3,10:41am
+    protected function weektime_lang($time){
+        if($this->lang == 'en'){
+            return date('D,H:ia',$time);
+        }else{
+            return date('星期N,H:ia',$time);
+        }
+    }
+
     /**
      * 操作成功返回的数据
      * @param string $msg    提示信息