'department_id']; const TYPE_CYCLE = 1; // 周期模式 const TYPE_CUSTOM = 2; // 自定义模式 //数据权限字段 public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setTable(plugin()->webman->config('database.activity_table')); } /** * 渠道信息 * @return BelongsTo */ public function channel(): BelongsTo { return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed(); } /** * 活动内容 * @return hasMany */ public function activity_content(): hasMany { return $this->hasMany(plugin()->webman->config('database.activity_content_model'), 'activity_id'); } /** * 充值配置 * @return BelongsTo */ public function channelRechargeSetting(): BelongsTo { return $this->belongsTo(plugin()->webman->config('database.channel_recharge_setting_model'), 'recharge_id')->withTrashed(); } }