'array', 'file' => StorageFile::class, 'check_status' => CheckStatus::class, 'check_at' => 'datetime', ]; protected $attributes = [ 'check_status' => CheckStatus::None, ]; protected $appends = ['check_status_text']; public static function getTypeList() { return Keyword::where('key', 'like', 'score_cate_%')->get(); } public function type() { return $this->belongsTo(Keyword::class, 'type_id'); } public function cate() { return $this->belongsTo(PartyCate::class, 'cate_id'); } public function user() { return $this->belongsTo(PartyUser::class, 'user_id'); } public function checkUser() { return $this->belongsTo(AdminUser::class, 'check_user_id'); } protected function checkStatusText(): Attribute { return new Attribute( get: fn () => $this->check_status ? $this->check_status->text() : '', ); } public function scopeSort($q) { $this->orderBy('check_status')->latest('created_at'); } }