瀏覽代碼

后台新旧会员

lizhen_gitee 8 月之前
父節點
當前提交
0c4706d0ef

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

@@ -25,6 +25,7 @@ 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("noticeEmailList", $this->model->getNoticeEmailList());
         $this->view->assign("noticeWhatsappList", $this->model->getNoticeWhatsappList());
         $this->view->assign("isFirstList", $this->model->getIsFirstList());

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

@@ -30,6 +30,9 @@ return [
     'Status'            => 'Status',
     'Status 0'          => 'Off',
     'Status 1'          => 'On',
+    'Oldstatus'         => 'New or Old',
+    'Oldstatus 0'       => 'New user',
+    'Oldstatus 1'       => 'Old user',
     'Verification'      => 'Verification',
     'Height'            => 'Height',
     'Age'               => 'Age',

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

@@ -30,6 +30,9 @@ return [
     'Status'            => '状态',
     'Status 0'          => '禁用',
     'Status 1'          => '正常',
+    'Oldstatus'         => '新旧会员',
+    'Oldstatus 0'       => '新会员',
+    'Oldstatus 1'       => '旧会员',
     'Verification'      => '验证',
     'Height'            => '身高',
     'Age'               => '年龄',

+ 15 - 0
application/admin/model/User.php

@@ -29,6 +29,7 @@ class User extends Model
         'logintime_text',
         'jointime_text',
         'status_text',
+        'oldstatus_text',
         'notice_email_text',
         'notice_whatsapp_text',
         'is_first_text'
@@ -41,6 +42,12 @@ class User extends Model
         return ['0' => __('Status 0'), '1' => __('Status 1')];
     }
 
+
+    public function getOldStatusList()
+    {
+        return ['0' => __('Oldstatus 0'), '1' => __('Oldstatus 1')];
+    }
+
     public function getNoticeEmailList()
     {
         return ['1' => __('Notice_email 1'), '0' => __('Notice_email 0')];
@@ -86,6 +93,14 @@ class User extends Model
     }
 
 
+    public function getOldStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['oldstatus']) ? $data['oldstatus'] : '');
+        $list = $this->getOldStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
     public function getNoticeEmailTextAttr($value, $data)
     {
         $value = $value ? $value : (isset($data['notice_email']) ? $data['notice_email'] : '');

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

@@ -66,6 +66,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 //                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
 //                        {field: 'token', title: __('Token'), operate: 'LIKE'},
                         {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
+                        {field: 'oldstatus', title: __('Oldstatus'), searchList: {"0":__('Oldstatus 0'),"1":__('Oldstatus 1')}, formatter: Table.api.formatter.status},
 //                        {field: 'verification', title: __('Verification'), operate: 'LIKE'},
 
                         {field: 'knowus', title: __('Knowus'), operate: 'LIKE'},