setTable(plugin()->webman->config('database.department_table')); } protected static function booted() { //创建时间倒序 static::addGlobalScope('sort', function (Builder $builder) { $builder->latest(); }); } protected function getPidAttribute($value) { return (int)$value; } /** * 渠道信息 * @return HasOne */ public function channel(): HasOne { return $this->hasOne(plugin()->webman->config('database.channel_model'), 'department_id'); } }