Browse Source

重建用户

lizhen_gitee 8 months ago
parent
commit
522f1f1d74

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

@@ -301,7 +301,7 @@ class Lessonslot extends Backend
         //教练列表
         $coach_map = [];
         if(!empty($coach_id)){
-            $coach_map['coach_ids'] = ['IN',$coach_id];
+            $coach_map['id'] = ['IN',$coach_id];
         }
         $coach_list = Db::name('coach')->where($coach_map)->order('id desc')->select();
 

+ 2 - 1
application/admin/controller/user/User.php

@@ -25,9 +25,10 @@ class User extends Backend
         parent::_initialize();
         $this->model = new \app\admin\model\User;
         $this->view->assign("statusList", $this->model->getStatusList());
-        $this->view->assign("oldstatusList", $this->model->getOldStatusList());
+        $this->view->assign("oldstatusList", $this->model->getOldstatusList());
         $this->view->assign("noticeEmailList", $this->model->getNoticeEmailList());
         $this->view->assign("noticeWhatsappList", $this->model->getNoticeWhatsappList());
+        $this->view->assign("noticePhonecallList", $this->model->getNoticePhonecallList());
         $this->view->assign("isFirstList", $this->model->getIsFirstList());
     }
 

+ 17 - 4
application/admin/model/User.php

@@ -32,6 +32,7 @@ class User extends Model
         'oldstatus_text',
         'notice_email_text',
         'notice_whatsapp_text',
+        'notice_phonecall_text',
         'is_first_text'
     ];
     
@@ -42,8 +43,7 @@ class User extends Model
         return ['0' => __('Status 0'), '1' => __('Status 1')];
     }
 
-
-    public function getOldStatusList()
+    public function getOldstatusList()
     {
         return ['0' => __('Oldstatus 0'), '1' => __('Oldstatus 1')];
     }
@@ -58,6 +58,11 @@ class User extends Model
         return ['1' => __('Notice_whatsapp 1'), '0' => __('Notice_whatsapp 0')];
     }
 
+    public function getNoticePhonecallList()
+    {
+        return ['1' => __('Notice_phonecall 1'), '0' => __('Notice_phonecall 0')];
+    }
+
     public function getIsFirstList()
     {
         return ['0' => __('Is_first 0'), '1' => __('Is_first 1')];
@@ -93,10 +98,10 @@ class User extends Model
     }
 
 
-    public function getOldStatusTextAttr($value, $data)
+    public function getOldstatusTextAttr($value, $data)
     {
         $value = $value ? $value : (isset($data['oldstatus']) ? $data['oldstatus'] : '');
-        $list = $this->getOldStatusList();
+        $list = $this->getOldstatusList();
         return isset($list[$value]) ? $list[$value] : '';
     }
 
@@ -117,6 +122,14 @@ class User extends Model
     }
 
 
+    public function getNoticePhonecallTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['notice_phonecall']) ? $data['notice_phonecall'] : '');
+        $list = $this->getNoticePhonecallList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
     public function getIsFirstTextAttr($value, $data)
     {
         $value = $value ? $value : (isset($data['is_first']) ? $data['is_first'] : '');

+ 36 - 0
application/admin/view/user/user/add.html

@@ -159,6 +159,18 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Oldstatus')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="oldstatusList" item="vo"}
+            <label for="row[oldstatus]-{$key}"><input id="row[oldstatus]-{$key}" name="row[oldstatus]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Verification')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-verification" class="form-control" name="row[verification]" type="text" value="">
@@ -213,6 +225,18 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Notice_phonecall')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-notice_phonecall" class="form-control selectpicker" name="row[notice_phonecall]">
+                {foreach name="noticePhonecallList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Whatsapp')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-whatsapp" class="form-control" name="row[whatsapp]" type="text" value="">
@@ -237,6 +261,12 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Emergency_phone')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-emergency_phone" class="form-control" name="row[emergency_phone]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Is_first')}:</label>
         <div class="col-xs-12 col-sm-8">
                         
@@ -248,6 +278,12 @@
 
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Residential')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-residential" class="form-control" name="row[residential]" type="text" value="">
+        </div>
+    </div>
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">

+ 36 - 0
application/admin/view/user/user/edit.html

@@ -159,6 +159,18 @@
         </div>
     </div>
     <!--<div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Oldstatus')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="oldstatusList" item="vo"}
+            <label for="row[oldstatus]-{$key}"><input id="row[oldstatus]-{$key}" name="row[oldstatus]" type="radio" value="{$key}" {in name="key" value="$row.oldstatus"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Verification')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-verification" class="form-control" name="row[verification]" type="text" value="{$row.verification|htmlentities}">
@@ -213,6 +225,18 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Notice_phonecall')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-notice_phonecall" class="form-control selectpicker" name="row[notice_phonecall]">
+                {foreach name="noticePhonecallList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.notice_phonecall"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Whatsapp')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-whatsapp" class="form-control" name="row[whatsapp]" type="text" value="{$row.whatsapp|htmlentities}">
@@ -237,6 +261,12 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Emergency_phone')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-emergency_phone" class="form-control" name="row[emergency_phone]" type="text" value="{$row.emergency_phone|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Is_first')}:</label>
         <div class="col-xs-12 col-sm-8">
                         
@@ -248,6 +278,12 @@
 
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Residential')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-residential" class="form-control" name="row[residential]" type="text" value="{$row.residential|htmlentities}">
+        </div>
+    </div>
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">