'integer', 'percent' => 'decimal:4', 'price_per_percent' => 'decimal:4', 'amount' => 'decimal:4', 'completed_at' => 'datetime', ]; public function agent() { return $this->belongsTo(Agent::class); } public function getStatusTextAttribute(): string { return [self::STATUS_PENDING => '待付款', self::STATUS_COMPLETED => '已开通', self::STATUS_CANCELLED => '已取消'][(string) $this->status] ?? ''; } }