Browse Source

课程表是否复制字段

lizhen_gitee 1 month ago
parent
commit
29ed25a3b5

+ 1 - 0
application/admin/controller/Lessonslot.php

@@ -27,6 +27,7 @@ class Lessonslot extends Backend
         $this->view->assign("statusList", $this->model->getStatusList());
         $this->view->assign("noticeStatusList", $this->model->getNoticeStatusList());
         $this->view->assign("isShowList", $this->model->getIsShowList());
+        $this->view->assign("copyStatusList", $this->model->getCopyStatusList());
     }
 
 

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

@@ -27,6 +27,9 @@ return [
     'Is_show'       => 'Show & Booking?',
     'Is_show 1'     => 'Show & Booking',
     'Is_show 0'     => 'Only Show',
+    'Copy_status'       => 'Copy or not?',
+    'Copy_status 1'     => 'Copy',
+    'Copy_status 0'     => 'No',
     'Coach.nickname'  => 'Coach nickname',
     'Lesson.name'     => 'Lesson name',
     'Lesson.name_en'  => 'Lesson name(en)',

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

@@ -29,6 +29,9 @@ return [
     'Is_show'                => '显示与预约?',
     'Is_show 1'              => '显示+预约',
     'Is_show 0'              => '仅显示',
+    'Copy_status'            => '是否复制?',
+    'Copy_status 1'          => '复制',
+    'Copy_status 0'          => '不复制',
     'Danceroom_id'           => '舞蹈室id',
     'Coach.nickname'         => '教练昵称',
     'Lesson.name'            => '课程标题',

+ 12 - 1
application/admin/model/Lessonslot.php

@@ -31,7 +31,8 @@ class Lessonslot extends Model
         'notice_status_text',
         'finishtime_text',
         'cancel_time_text',
-        'is_show_text'
+        'is_show_text',
+        'copy_status_text',
     ];
     
 
@@ -61,6 +62,10 @@ class Lessonslot extends Model
         return ['1' => __('Is_show 1'), '0' => __('Is_show 0')];
     }
 
+    public function getCopyStatusList()
+    {
+        return ['1' => __('Copy_status 1'), '0' => __('Copy_status 0')];
+    }
 
     public function getStarttimeTextAttr($value, $data)
     {
@@ -132,6 +137,12 @@ class Lessonslot extends Model
         return isset($list[$value]) ? $list[$value] : '';
     }
 
+    public function getCopyStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['copy_status']) ? $data['copy_status'] : '');
+        $list = $this->getCopyStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
 
     public function coach()
     {

+ 12 - 0
application/admin/view/lessonslot/add.html

@@ -102,6 +102,18 @@
 
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Copy_status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+
+            <select  id="c-copy_status" data-rule="required" class="form-control selectpicker" name="row[copy_status]">
+                {foreach name="copyStatusList" item="vo"}
+                <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
     <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Notice_status')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 12 - 0
application/admin/view/lessonslot/edit.html

@@ -102,6 +102,18 @@
 
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Copy_status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+
+            <select  id="c-copy_status" data-rule="required" class="form-control selectpicker" name="row[copy_status]">
+                {foreach name="copyStatusList" item="vo"}
+                <option value="{$key}" {in name="key" value="$row.copy_status"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
     <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Notice_status')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 1 - 1
application/index/controller/Plantask.php

@@ -646,7 +646,7 @@ class Plantask extends Controller
         $starttime = strtotime('this week Monday'); // 获取本周一的时间戳
         $endtime   = $starttime + (86400*14);
 
-        $list = Db::name('lesson_slot')->where('starttime','BETWEEN',[$starttime,$endtime])->order('starttime asc')->select();
+        $list = Db::name('lesson_slot')->where('starttime','BETWEEN',[$starttime,$endtime])->where('copy_status',1)->order('starttime asc')->select();
         if(empty($list)){
             echo 'empty';
             exit;

+ 1 - 0
public/assets/js/backend/lessonslot.js

@@ -58,6 +58,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'cancel_reason', title: __('Cancel_reason'), operate: 'LIKE'},
                         {field: 'cancel_time', title: __('Cancel_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'is_show', title: __('Is_show'), searchList: {"1":__('Is_show 1'),"0":__('Is_show 0')}, formatter: Table.api.formatter.normal},
+                        {field: 'copy_status', title: __('Copy_status'), searchList: {"1":__('Copy_status 1'),"0":__('Copy_status 0')}, formatter: Table.api.formatter.normal},
 //                        {field: 'cancel_notice_status', title: __('Cancel_notice_status'), searchList: {"0":__('Cancel_notice_status 0'),"1":__('Cancel_notice_status 1')}, formatter: Table.api.formatter.status},
                         {field: 'danceroom_id', title: __('Danceroom_id')},
                         {field: 'danceroom.name', title: __('Danceroom.name'), operate: 'LIKE'},