改为独立座驾模块

This commit is contained in:
pllx
2026-04-30 09:55:20 +08:00
parent 3c95478097
commit 181cc6a0b0
22 changed files with 886 additions and 216 deletions
+1 -23
View File
@@ -15,8 +15,6 @@ class ShopItem extends Model
{
public const TYPE_SIGN_REPAIR = 'sign_repair';
public const TYPE_RIDE = 'ride';
public const DECORATION_TYPES = ['msg_bubble', 'msg_name_color', 'msg_text_color', 'avatar_frame'];
protected $table = 'shop_items';
@@ -24,7 +22,7 @@ class ShopItem extends Model
protected $fillable = [
'name', 'slug', 'description', 'icon', 'price',
'type', 'duration_days', 'duration_minutes', 'sort_order', 'is_active',
'intimacy_bonus', 'charm_bonus', 'welcome_message',
'intimacy_bonus', 'charm_bonus',
];
protected $casts = [
@@ -63,14 +61,6 @@ class ShopItem extends Model
return in_array($this->type, self::DECORATION_TYPES, true);
}
/**
* 是否为聊天室座驾商品。
*/
public function isRide(): bool
{
return $this->type === self::TYPE_RIDE;
}
/**
* 是否为特效类商品(instant durationslug once_ week_ 开头)
*/
@@ -110,18 +100,6 @@ class ShopItem extends Model
return null;
}
/**
* 获取座驾全屏特效 key(去掉 ride_ 前缀)。
*/
public function rideKey(): ?string
{
if (str_starts_with($this->slug, 'ride_')) {
return substr($this->slug, 5);
}
return null;
}
/**
* 获取所有上架商品(按排序)
*/