改为独立座驾模块
This commit is contained in:
+1
-23
@@ -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 或 duration,slug 以 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有上架商品(按排序)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user