mirror of
https://github.com/coaidev/coai.git
synced 2025-05-31 19:00:22 +09:00
update subscription
This commit is contained in:
parent
73788c3b59
commit
322327f64b
@ -123,6 +123,7 @@ const resources = {
|
||||
3: "3 Months",
|
||||
6: "6 Months",
|
||||
12: "1 Year",
|
||||
36: "3 Years",
|
||||
},
|
||||
success: "Subscribe success",
|
||||
"success-prompt":
|
||||
@ -284,6 +285,7 @@ const resources = {
|
||||
3: "3个月",
|
||||
6: "半年",
|
||||
12: "1年",
|
||||
36: "3年",
|
||||
},
|
||||
success: "订阅成功",
|
||||
"success-prompt": "您已成功订阅 {{month}} 月专业版。",
|
||||
@ -449,6 +451,7 @@ const resources = {
|
||||
3: "3 месяца",
|
||||
6: "6 месяцев",
|
||||
12: "1 год",
|
||||
36: "3 года",
|
||||
},
|
||||
success: "Подписка успешна",
|
||||
"success-prompt": "Вы успешно подписались на {{month}} месяцев Pro.",
|
||||
|
@ -115,6 +115,12 @@ function Upgrade({ children }: UpgradeProps) {
|
||||
{t(`percent`, { cent: 8 })}
|
||||
</Badge>
|
||||
</SelectItem>
|
||||
<SelectItem value={"36"}>
|
||||
{t(`sub.time.36`)}
|
||||
<Badge className={`ml-2 cent`}>
|
||||
{t(`percent`, { cent: 7 })}
|
||||
</Badge>
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p className={`price`}>
|
||||
|
@ -9,10 +9,15 @@ import (
|
||||
)
|
||||
|
||||
func CountSubscriptionPrize(month int) float32 {
|
||||
if month >= 12 {
|
||||
return 8 * float32(month) * 0.9
|
||||
base := 8 * float32(month)
|
||||
if month >= 36 {
|
||||
return base * 0.7
|
||||
} else if month >= 12 {
|
||||
return base * 0.8
|
||||
} else if month >= 6 {
|
||||
return base * 0.9
|
||||
}
|
||||
return 8 * float32(month)
|
||||
return base
|
||||
}
|
||||
|
||||
func BuySubscription(db *sql.DB, user *User, month int) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user