'department_id']; //简写省略id,默认后台用户表的id public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setTable(plugin()->webman->config('database.commission_record_table')); } /** * 渠道信息 * @return BelongsTo */ public function channel(): BelongsTo { return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed(); } /** * 玩家信息 * @return BelongsTo */ public function player(): BelongsTo { return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id'); } /** * 分润玩家信息 * @return BelongsTo */ public function parentPlayer(): BelongsTo { return $this->belongsTo(plugin()->webman->config('database.player_model'), 'parent_player_id'); } }