|
|
@@ -13,6 +13,7 @@ use Illuminate\Database\Eloquent\Builder;
|
|
|
* Admin
|
|
|
* @mixin Builder
|
|
|
* @method static Builder|static where($column, $operator = null, $value = null, $boolean = 'and')
|
|
|
+ * @property mixed $id
|
|
|
*/
|
|
|
class Admin extends Model implements Authenticatable
|
|
|
{
|
|
|
@@ -21,6 +22,7 @@ class Admin extends Model implements Authenticatable
|
|
|
protected $hidden = ['password', 'created_at', 'updated_at'];
|
|
|
protected $fillable = ['username','nickname','password','sex','cellphone','email','remarks', 'created_at', 'updated_at'];
|
|
|
protected $appends = ['roles_ids', 'roles_names'];
|
|
|
+
|
|
|
public static function login($username, $password)
|
|
|
{
|
|
|
$map = [];
|
|
|
@@ -46,4 +48,10 @@ class Admin extends Model implements Authenticatable
|
|
|
{
|
|
|
return $this->roles->pluck('display_name')->toArray();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public function getId()
|
|
|
+ {
|
|
|
+ return $this->id;
|
|
|
+ }
|
|
|
}
|