<?php /** * Created by PhpStorm * User:林志杰 * Email:598287049@qq.com * Motto:纵有疾风起,人生不言弃! * Time:2020/1/3 0:29 */ namespace app\common\model\mysql; use think\Model; class AdminUser extends Model { /** * 根据用户名获取后端用户表的数据 * @param $username * @return array|bool|Model|null * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getAdminUserByUsername($username) { if (empty($username)) { return false; } $where = [ 'username' => trim($username), ]; $result = $this->where($where)->find(); return $result; } }