xieruidong 2 年之前
父节点
当前提交
a4f13127f6

+ 1 - 0
application/admin/controller/auth/Admin.php

@@ -96,6 +96,7 @@ class Admin extends Backend
 
             $list = $this->model
                 ->where($where)
+                ->filterAdmin()
                 ->where('id', 'in', $this->childrenAdminIds)
                 ->field(['password', 'salt', 'token'], true)
                 ->order($sort, $order)

+ 4 - 2
application/admin/model/Admin.php

@@ -6,8 +6,7 @@ use think\db\Query;
 use think\Model;
 use think\Session;
 /**
- *@method static Query|static proxy()
- *@method static Query|static sub()
+ *@method static Query|static filterAdmin()
  * @property bool is_seller
  */
 class Admin extends Model
@@ -72,4 +71,7 @@ class Admin extends Model
         return str_replace('{frommanager}',$model['id'],config('site.sell_share_url')?:'');
         return sprintf('%s/register',request()->domain(),);
     }
+    public function scopeFilterAdmin(Query $query){
+        $query->where('user_type',self::UT_ADMIN);
+    }
 }

+ 1 - 1
public/assets/js/backend/auth/admin.js

@@ -32,7 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'state', checkbox: true, },
                         {field: 'id', title: 'ID'},
                         {field: 'username', title: __('Username')},
-                        {field: 'phone', title: __('手机号')},
+                        {field: 'mobile', title: __('手机号')},
                         {field: 'nickname', title: __('Nickname')},
                         //{field: 'job', title: __('岗位')},
                         {field: 'groups_text', title: __('Group'), operate:false, formatter: Table.api.formatter.label},