diff --git a/app/admin/model/SystemNotice.php b/app/admin/model/SystemNotice.php new file mode 100644 index 0000000..8901d3d --- /dev/null +++ b/app/admin/model/SystemNotice.php @@ -0,0 +1,9 @@ +belongsTo('app\admin\model\SystemAdmin', 'send_admin_id', 'id'); + } +} diff --git a/extend/base/admin/model/SystemNoticeSubscribeBase.php b/extend/base/admin/model/SystemNoticeSubscribeBase.php new file mode 100644 index 0000000..22fec40 --- /dev/null +++ b/extend/base/admin/model/SystemNoticeSubscribeBase.php @@ -0,0 +1,23 @@ +belongsTo('app\admin\model\SystemNotice', 'notice_id', 'id'); + } + + /** + * 接收管理员. + * 仅按需显式调用时才查询;列表页请勿用 withJoin 预载 + * (system_admin 与主表存在 id/status 等同名字段,join 会产生歧义)。 + */ + public function admin() + { + return $this->belongsTo('app\admin\model\SystemAdmin', 'admin_id', 'id'); + } +}