mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-22 18:14:27 +08:00
更新后端基础
This commit is contained in:
30
app/models/User.php
Normal file
30
app/models/User.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\models;
|
||||
|
||||
use app\common\base\BaseModel;
|
||||
|
||||
/**
|
||||
* 用户模型
|
||||
*
|
||||
* 对应表:users
|
||||
*/
|
||||
class User extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 表名
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'users';
|
||||
|
||||
/**
|
||||
* 关联角色(多对多)
|
||||
*/
|
||||
public function roles()
|
||||
{
|
||||
return $this->belongsToMany(Role::class, 'role_user', 'user_id', 'role_id');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user