33 lines
933 B
PHP
33 lines
933 B
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | YwxApp [ WE CAN DO IT JUST THINK ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Author: ywxapp<admin@ywxapp.cn>
|
|
// +----------------------------------------------------------------------
|
|
declare (strict_types = 1);
|
|
|
|
namespace addon\wxchat\model;
|
|
|
|
use think\Model;
|
|
use ywxapp\model\MemberUser;
|
|
|
|
class WxchatGroup extends Model
|
|
{
|
|
protected $name = 'wxchat_groups';
|
|
|
|
// 关联成员
|
|
|
|
public function members()
|
|
{
|
|
return $this->belongsToMany(MemberUser::class, 'group_members', 'user_id', 'group_id');
|
|
}
|
|
|
|
// 关联创建者
|
|
|
|
public function creator()
|
|
{
|
|
return $this->belongsTo(MemberUser::class, 'creator_id');
|
|
}
|
|
} |