* 管理 */ namespace app\guard\model; use think\Model; class GuardUser extends Model{ protected $pk = 'id'; //和主用户表绑定关系 public function user(){ return $this->hasOne('app\common\model\SystemUser','id','uid'); } //绑定帐号关系 public function history(){ return $this->hasMany('GuardHistory','uid','uid'); } }