now there is a project, and the demand is too painful!
the price of each type of vip, from vip1 to vip5, is different!
there is a data table in the backend that stores vip type vip_type
with vip type price (money) and grade (level)
now users write a record in vip_open in the activation table after purchase!
vip_open table field:
user_id --id
vip_id -- vipid
open_time -- ()
open_money --
open_length -- ()
end_time -- ()
then you can simply overlay the end_time when you renew it.
but it hurts when users upgrade!
refer to large-scale ones such as Baidu disk QQ VIP
they temporarily disable the previous one after upgrading, then write the vip data after the upgrade, and then disable it before it is enabled after the upgrade expires!
this way doesn"t feel good for my needs!
Please advise if there is any other way to upgrade directly!