wugg 9 months ago
parent
commit
9622c2a28d
2 changed files with 7 additions and 6 deletions
  1. 6 6
      app/user/controller/User.php
  2. 1 0
      app/user/model/AccountItem.php

+ 6 - 6
app/user/controller/User.php

@@ -21,10 +21,10 @@ class User extends Base
         if($post['level']!=0) $where[]=['level','=',$post['level']];
          if($post['itemid']!=0) $where[]=['accountItem.itemid','=',$post['itemid']];
         $list=$this->model->with(['accountItem'=>['itemName'],'company_relaton'])
-        ->withJoin(['userInfo',"accountItem"],'left')
+        ->withJoin(['userInfo',"account_item"],'left')
         ->where($where)->order('account.id asc')
         ->paginate(['list_rows'=>$post['size'],'page'=>$post['page']]);
-        $list->hidden(['userInfo','password','salt','accountItem']);
+        $list->hidden(['userInfo','password','salt','account_item','accountItem']);
         return success('获取成功',['list'=>$list->items(),'count'=>$list->total()]);
   }
   
@@ -38,10 +38,10 @@ class User extends Base
     public function userChange(){
         $param  =$this->request->param([
         	'id'=>"",
-        	'nickname'=>'',
-        	'mobile'=>'',
-        	'level'=>'',
-        	'status'=>''],'post','trim');
+        	'nickname',
+        	'mobile',
+        	'level',
+        	'status'],'post','trim');
         $valid = Validate::rule([
         	"id|账户id"=>"require|number|gt:0",
         	"nickname|账户名称"=>"max:255",

+ 1 - 0
app/user/model/AccountItem.php

@@ -15,6 +15,7 @@ class AccountItem extends Base
     ];
     protected $updateTime='updatetime';
     protected $createTime='addtime';
+    protected $hidden=["id","addtime"];
     public function ItemName(){
         return $this->belongsTo(CompanyItem::class,"itemid")->bind(["depart_name"=>"name","depart_link"]);
     }