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