'department_id']; const PRIORITY_ORDINARY = 1; // 普通 const PRIORITY_SENIOR = 2; // 高级 const PRIORITY_EMERGENT = 3; // 紧急 const TYPE_BULLETIN = 1; // 公告 const TYPE_EVEBT = 2; // 事件 public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setTable(plugin()->webman->config('database.announcement_table')); } /** * 游戏类别 * @return BelongsTo */ public function adminUser(): BelongsTo { return $this->belongsTo(plugin()->webman->config('database.user_model'), 'admin_id'); } /** * 渠道信息 * @return BelongsTo */ public function channel(): BelongsTo { return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed(); } /** * 渠道信息 * @return hasMany */ public function content(): hasMany { return $this->hasMany(plugin()->webman->config('database.announcement_content_model'), 'announcement_id'); } }