AdminAccount.php 513 B

123456789101112131415161718
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\Admin\model;
  4. use think\Model;
  5. /**
  6. * @mixin \think\Model
  7. */
  8. class AdminAccount extends Model
  9. {
  10. public function GetUserById($accoutID){
  11. return $this->alias("a")->leftJoin("CFP_admin_account_relation b","a.id=b.account_id")->leftJoin("CFP_admin_user u","b.user_id=u.id")
  12. ->leftJoin("CFP_role r","b.role_id=r.id")->field("a.id,username,name,mobile,avatar,rolename,role_id,status")->where("a.id","=",$accoutID)
  13. ->find();
  14. }
  15. }