Browse Source

用户审核状态tab页

zhangxiaobin 1 năm trước cách đây
mục cha
commit
0c0b1df4d2

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

@@ -38,9 +38,10 @@ class User extends Backend
             'isCoolList' => $this->model->getIsCoolList(),
             'isManagerList' => $this->model->getIsManagerList(),
             'isStealthList' => $this->model->getIsStealthList(),
+            'statusList' => $this->model->getStatusList(),
+            'needCheckList' => $this->model->getNeedCheckList(),
         ];
         $this->view->assign($typeList);
-        $this->assignconfig($typeList);
     }
 
     /**
@@ -293,6 +294,7 @@ class User extends Backend
                         $statusStr = '头像拒绝';
                     }
                 }
+                $params['need_check'] = 0;
 
                 $result = $row->allowField(true)->save($params);
             } catch (ValidateException|PDOException|Exception $e) {

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

@@ -53,5 +53,8 @@ return [
     'Is_stealth 0'                                => '否',
     'Is_stealth 1'                                => '是',
     'Status'                                      => '状态',
+    'Need_check'                                  => '审核状态',
+    'Need_check 0'                                => '正常',
+    'Need_check 1'                                => '待审核',
     'Leave password blank if dont want to change' => '不修改密码请留空',
 ];

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

@@ -22,6 +22,7 @@ class User extends Model
         'is_cool_text',
         'is_manager_text',
         'is_stealth_text',
+        'need_check_text',
     ];
 
     public function getOriginData()
@@ -66,6 +67,18 @@ class User extends Model
         return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
     }
 
+    public function getNeedCheckList()
+    {
+        return [0 => __('Need_check 0'), 1 => __('Need_check 1')];
+    }
+
+    public function getNeedCheckTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['need_check']) ? $data['need_check'] : '');
+        $list = $this->getNeedCheckList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
     public function getPrevtimeTextAttr($value, $data)
     {
         $value = $value ? $value : $data['prevtime'];

+ 9 - 1
application/admin/view/user/user/index.html

@@ -1,5 +1,13 @@
 <div class="panel panel-default panel-intro">
-    {:build_heading()}
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="need_check">
+            <li class="{:$Think.get.need_check == null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="needCheckList" item="vo"}
+            <li class="{:$Think.get.need_check == (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
 
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">

+ 1 - 0
application/api/controller/Usercenter.php

@@ -661,6 +661,7 @@ class UserCenter extends Common
             $data["pre_nickname"] = $nickname;
         }
         if (!empty($data)) {
+            $data['need_check'] = 1;
             $where["id"] = $this->auth->id;
             $res = $this->userModel->update($data,$where);
             if(!$res) {

+ 4 - 3
public/assets/js/backend/user/user.js

@@ -60,13 +60,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         // {field: 'noble_duetime', title: __('NobleDuetime'), formatter: Table.api.formatter.datetime, operate: 'RANGE'},
                         {field: 'age.name', title: __('Age_id'), operate: false},
                         {field: 'constellation.name', title: __('Constellation_id'), operate: false},
-                        {field: 'is_cool', title: __('Is_cool'), searchList:Config.isCoolList, formatter: Table.api.formatter.status},
-                        {field: 'is_manager', title: __('Is_manager'), searchList:Config.isManagerList, formatter: Table.api.formatter.status},
-                        {field: 'is_stealth', title: __('Is_stealth'), searchList:Config.isStealthList, formatter: Table.api.formatter.status},
+                        {field: 'is_cool', title: __('Is_cool'), searchList:{'0': __('Is_cool 0'), '1':__('Is_cool 1')}, formatter: Table.api.formatter.status},
+                        {field: 'is_manager', title: __('Is_manager'), searchList:{'0' : __('Is_manager 0'), '1':__('Is_manager 1')}, formatter: Table.api.formatter.status},
+                        {field: 'is_stealth', title: __('Is_stealth'), searchList:{'0' :__('Is_stealth 0'), '1' :__('Is_stealth 1')}, formatter: Table.api.formatter.status},
                         {field: 'logintime', title: __('Logintime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                         {field: 'loginip', title: __('Loginip'), formatter: Table.api.formatter.search},
                         {field: 'createtime', title: __('Jointime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                         {field: 'joinip', title: __('Joinip'), formatter: Table.api.formatter.search},
+                        {field: 'need_check', title: __('Need_check'), searchList:{'0':__('Need_check 0'), '1' :__('Need_check 1')}, formatter: Table.api.formatter.status},
                         {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
                         {
                             field: 'operate', title: __('Operate'), buttons: [