瀏覽代碼

课程表,显示与预约

lizhen_gitee 7 月之前
父節點
當前提交
281169d8d6

+ 3 - 3
application/admin/lang/en/lessonslot.php

@@ -22,9 +22,9 @@ return [
     'Finishtime'      => 'Signed time',
     'Cancel_reason'   => 'Cancel reason',
     'Cancel_time'     => 'Cancel time',
-    'Is_show'       => 'Show on APP?',
-    'Is_show 1'     => 'show',
-    'Is_show 0'     => 'INTERNAL USE ONLY',
+    'Is_show'       => 'Show & Booking?',
+    'Is_show 1'     => 'Show & Booking',
+    'Is_show 0'     => 'Only Show',
     'Coach.nickname'  => 'Coach nickname',
     'Lesson.name'     => 'Lesson name',
     'Lesson.name_en'  => 'Lesson name(en)',

+ 3 - 3
application/admin/lang/zh-cn/lessonslot.php

@@ -23,9 +23,9 @@ return [
     'Finishtime'             => '点名时间',
     'Cancel_reason'          => '取消原因',
     'Cancel_time'            => '取消时间',
-    'Is_show'                => '客人可以预约?',
-    'Is_show 1'              => '可以',
-    'Is_show 0'              => '仅内部',
+    'Is_show'                => '显示与预约?',
+    'Is_show 1'              => '显示+预约',
+    'Is_show 0'              => '仅显示',
     'Danceroom_id'           => '舞蹈室id',
     'Coach.nickname'         => '教练昵称',
     'Lesson.name'            => '课程标题',

+ 7 - 2
application/api/controller/Lesson.php

@@ -176,8 +176,8 @@ class Lesson extends Api
 
         $where = [
             'slot.starttime' => ['BETWEEN',[$date,$date+86399]],
-            'slot.status' => 0,
-            'slot.is_show' => 1,
+            'slot.status' => 0,  //状态:0=报名中,20=已点名,30=已取消
+            //'slot.is_show' => 1, //是否显示:1=上架,0=下架
         ];
 
 
@@ -258,6 +258,11 @@ class Lesson extends Api
                     $slot['num_remark'] .= '--'. __('候补:') .$wait_number.'/'.$slot['waitnum_max'];
                 }
             }
+            //上下架的影响
+            if($slot['is_show'] == 0){
+                $slot['num_remark'] = __('限制预约');
+                $slot['button_status'] = 0;//不能预约,强制改
+            }
         }
 
         $this->success(1,$list);

+ 1 - 0
application/api/lang/en/lesson.php

@@ -6,6 +6,7 @@ return [
     '预约成功' => 'Booking successful',
 
     '报名已截止' => 'Booking Closed',
+    '限制预约' => 'Restricted reservation',
     '剩N个名额' => '{:number} places left',
 
     '课程可能已取消,请刷新重试' => 'The course may have been cancelled, please refresh and try again',