|
@@ -8,13 +8,12 @@ import (
|
|
|
"encoding/json"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
+ "github.com/gogf/gf/v2/database/gdb"
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
|
- "go.mongodb.org/mongo-driver/bson"
|
|
|
"io/ioutil"
|
|
|
"jyOrderManager/internal/jyutil"
|
|
|
"jyOrderManager/internal/model"
|
|
|
- "jyOrderManager/internal/service"
|
|
|
"log"
|
|
|
"net/http"
|
|
|
"net/url"
|
|
@@ -23,84 +22,42 @@ import (
|
|
|
)
|
|
|
|
|
|
const (
|
|
|
- Buy = iota + 1 //购买
|
|
|
- Renew //续费
|
|
|
- Upgrades //升级
|
|
|
- try //试用
|
|
|
+ Buy = iota + 1 //购买
|
|
|
+ Renew //续费
|
|
|
+ Upgrades //升级
|
|
|
+ try //试用
|
|
|
+ OrderDetailTab = "jy_product_detail"
|
|
|
)
|
|
|
|
|
|
-func (p jyBigProduct) CheckParam(param model.CreateBigParams) error {
|
|
|
- var ctx context.Context
|
|
|
- m, err := p.GetPrice()
|
|
|
+// getLinkFilter 获取关联订单
|
|
|
+func getLinkFilter(ctx context.Context, linkOrderDetailId int64) (filter *model.JyBigProductFilter, st, et time.Time, err error) {
|
|
|
+ var (
|
|
|
+ re gdb.Record
|
|
|
+ )
|
|
|
+ re, err = g.DB().GetOne(ctx, fmt.Sprintf("SELECT filter,service_starttime,service_endtime FROM jy_product_detail WHERE id =%d", linkOrderDetailId))
|
|
|
if err != nil {
|
|
|
- return errors.New("金额校验计算异常")
|
|
|
+ return
|
|
|
}
|
|
|
- if p.param.Amount != m {
|
|
|
- return errors.New("金额校验异常")
|
|
|
+ var (
|
|
|
+ dMap = re.Map()
|
|
|
+ )
|
|
|
+ if len(dMap) == 0 {
|
|
|
+ err = fmt.Errorf("获取关联订单异常")
|
|
|
+ return
|
|
|
}
|
|
|
- pcls, err := service.Product().GetProduct(p.param.ProductCode)
|
|
|
+ err = gconv.Struct(dMap["filter"], filter)
|
|
|
if err != nil {
|
|
|
- return errors.New("未知商品类型")
|
|
|
+ return
|
|
|
}
|
|
|
- if pcls.ProductClass.Tactics != 3 && p.param.Tactics != pcls.ProductClass.Tactics {
|
|
|
- return errors.New("销售策略不支持")
|
|
|
- }
|
|
|
-
|
|
|
- if param.RecordPayType == 0 {
|
|
|
- return errors.New("缺少订单类型")
|
|
|
- }
|
|
|
- // 暂不提供手机号
|
|
|
- if param.BuySubject != "2" && !strings.HasPrefix(param.Phone, "9") {
|
|
|
- //个人订单校验是否存在未审核订单
|
|
|
- if ExistProcessOrder(param.Phone, param.OrderCode) {
|
|
|
- return errors.New("该手机号存在未审核通过的单子")
|
|
|
- }
|
|
|
- //个人权益是否开通
|
|
|
- switch param.RecordPayType {
|
|
|
- case Buy, try: //购买 试用
|
|
|
- if userData, _, _, _ := jyutil.GetCreateUserData(param.Phone, "", false); userData != nil {
|
|
|
- tm := time.Now().Unix()
|
|
|
- if gconv.Int(userData["i_member_status"]) > 0 || gconv.Int64(userData["i_member_endtime"]) > tm {
|
|
|
- return errors.New("该手机号个人权益已生效")
|
|
|
- }
|
|
|
- }
|
|
|
- case Renew, Upgrades: //升级 续费
|
|
|
- if userData, _, _, _ := jyutil.GetCreateUserData(param.Phone, "", false); userData != nil {
|
|
|
- tm := time.Now().Unix()
|
|
|
- if gconv.Int(userData["i_member_status"]) <= 0 || gconv.Int64(userData["i_member_endtime"]) <= tm {
|
|
|
- return errors.New("该手机号个人权益已失效")
|
|
|
- }
|
|
|
- }
|
|
|
- default:
|
|
|
- return errors.New("订单类型错误")
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if param.PayCycle == 0 || param.PayCycleType == 0 {
|
|
|
- return errors.New("缺少周期")
|
|
|
- }
|
|
|
-
|
|
|
- if param.PayMoney == 0 && param.ZeroOrderType == "" {
|
|
|
- return errors.New("0元订单缺少类型")
|
|
|
+ st, err = time.Parse(time.DateTime, gconv.String(dMap["service_starttime"]))
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
}
|
|
|
- if param.ComboId != 0 {
|
|
|
- comboData, err := g.DB().Ctx(ctx).GetOne(ctx, fmt.Sprintf(`SELECT s_servers FROM bigmember_combo WHERE id=%d`, param.ComboId))
|
|
|
- if err != nil || comboData.IsEmpty() {
|
|
|
- return errors.New("套餐不存在")
|
|
|
- }
|
|
|
- var serviceIds []string
|
|
|
- serversData, err := g.DB().Ctx(ctx).Query(ctx, fmt.Sprintf(`SELECT s_servers FROM bigmember_service WHERE id in (%s)`, gconv.String(comboData.Map()["s_servers"])))
|
|
|
- if err != nil {
|
|
|
- return errors.New("获取服务异常")
|
|
|
- }
|
|
|
- for _, m := range serversData.List() {
|
|
|
- serviceIds = append(serviceIds, gconv.String(m["id"]))
|
|
|
- }
|
|
|
- param.ServersId = serviceIds
|
|
|
- } else if param.RecordPayType != Renew && len(param.ServersId) == 0 {
|
|
|
- return errors.New("服务id异常")
|
|
|
+ et, err = time.Parse(time.DateTime, gconv.String(dMap["service_endtime"]))
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
}
|
|
|
- return nil
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
// ExistProcessOrder 是否存在处理的订单(待一审、待二审、)
|
|
@@ -118,83 +75,39 @@ func ExistProcessOrder(phone string, orderCode string) bool {
|
|
|
}
|
|
|
|
|
|
// UserEquityDistribution 用户分配权益
|
|
|
-func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, endDate time.Time, entId int, pid int64, isEquity bool) error {
|
|
|
+func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, endDate time.Time) error {
|
|
|
status := common.If(startDate.Unix() <= time.Now().Unix(), 0, 1).(int)
|
|
|
- buyCount := 1
|
|
|
var serviceIdArr []string
|
|
|
if p.param.RecordPayType == Upgrades {
|
|
|
- if p.param.BuySubject == "2" {
|
|
|
- data, _ := g.DB().Ctx(ctx).Query(ctx, fmt.Sprintf(`select * from entniche_wait_empower where id = %d`, pid))
|
|
|
- if data != nil {
|
|
|
- for _, m := range data.List() {
|
|
|
- buyCount = common.IntAll(m["empower_count"])
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- serviceIdArr = p.param.SupServiceId
|
|
|
+ serviceIdArr = p.param.Filter.SupServiceIds
|
|
|
} else {
|
|
|
- serviceIdArr = p.param.ServersId
|
|
|
+ serviceIdArr = p.param.Filter.ServiceIds
|
|
|
}
|
|
|
serverData, _ := g.DB().Ctx(ctx).Query(ctx, fmt.Sprintf(`SELECT * FROM bigmember_service WHERE id in (%s) `, strings.Join(serviceIdArr, ",")))
|
|
|
if !serverData.IsEmpty() {
|
|
|
for _, m := range serverData.List() {
|
|
|
serverId := common.If(gconv.Int(m["p_id"]) > 0, gconv.Int(m["p_id"]), gconv.Int(m["id"])).(int)
|
|
|
mainId := gconv.Int(m["id"])
|
|
|
- if p.param.RecordPayType == Upgrades {
|
|
|
- userService, _ := g.DB().Ctx(ctx).Query(ctx, fmt.Sprintf("select * from bigmember_service_user where s_serviceid = %s and s_userid = '%s' and i_status != -1", serverId, p.param.UserId))
|
|
|
- if userService.Len() > 0 {
|
|
|
- log.Println("用户补充服务已存在")
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ userService, _ := g.DB().Ctx(ctx).Query(ctx, fmt.Sprintf("select * from bigmember_service_user where s_serviceid = %d and s_userid = '%s' and i_status != -1", serverId, p.param.UserId))
|
|
|
var (
|
|
|
- resourceType string
|
|
|
+ frequency int
|
|
|
)
|
|
|
|
|
|
- if strings.Contains(common.InterfaceToStr(m["s_name"]), "市场分析定制报告pdf下载") {
|
|
|
- resourceType = "市场分析定制报告下载包"
|
|
|
- } else if strings.Contains(common.InterfaceToStr(m["s_name"]), "业主采购分析报告pdf下载") {
|
|
|
- resourceType = "业主采购分析报告下载包"
|
|
|
- } else if strings.Contains(common.InterfaceToStr(m["s_name"]), "企业中标分析报告pdf下载") {
|
|
|
- resourceType = "企业中标分析报告下载包"
|
|
|
- }
|
|
|
- number := common.IntAll(m["s_count_year"])
|
|
|
- comboId := p.param.ComboId
|
|
|
- if comboId > 0 { //套餐 number*时间
|
|
|
- cycle := p.param.PayCycle //购买市场
|
|
|
- cycleType := p.param.PayCycleType //时间类型
|
|
|
- cycleFmt := common.If(cycleType == 0, 12, 366).(int)
|
|
|
- number = number * (cycle / cycleFmt)
|
|
|
- }
|
|
|
-
|
|
|
- var frequency int
|
|
|
-
|
|
|
switch serverId {
|
|
|
case 11:
|
|
|
- frequency = p.param.PayCycle * common.IntAll(m["s_count_month"])
|
|
|
+ frequency = p.param.Filter.BuyCycle * common.IntAll(m["s_count_month"])
|
|
|
case 15:
|
|
|
- if p.param.PayCycle >= 12 {
|
|
|
- frequency = (p.param.PayCycle / 12 * common.IntAll(m["s_count_year"])) + (p.param.PayCycle % 12 * common.IntAll(m["s_count_month"]))
|
|
|
+ if p.param.Filter.BuyCycle >= 12 {
|
|
|
+ frequency = (p.param.Filter.BuyCycle / 12 * common.IntAll(m["s_count_year"])) + (p.param.Filter.BuyCycle % 12 * common.IntAll(m["s_count_month"]))
|
|
|
} else {
|
|
|
- frequency = p.param.PayCycle * common.IntAll(m["s_count_month"])
|
|
|
+ frequency = p.param.Filter.BuyCycle * common.IntAll(m["s_count_month"])
|
|
|
}
|
|
|
default:
|
|
|
frequency = common.IntAll(m["s_count_month"])
|
|
|
}
|
|
|
switch p.param.RecordPayType {
|
|
|
case Buy, try: //购买 试用
|
|
|
- if number > 0 {
|
|
|
- count := common.If(p.param.BuySubject == "2", p.param.PAccountNumber, 1).(int)
|
|
|
- if err := AddPdfPack(p.param.UserId, p.param.UserId, resourceType, endDate.Format(date.Date_Short_Layout), number, count, entId, 1, pid); err != nil {
|
|
|
- log.Println("AddPdfPack err ", err)
|
|
|
- }
|
|
|
- }
|
|
|
- if !isEquity { //仅赠送pdf
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
- userServerData, _ := g.DB().Ctx(ctx).Query(ctx, fmt.Sprintf("select * from bigmember_service_user where s_serviceid = %d and s_userid = '%s' and i_status != -1", serverId, p.param.UserId))
|
|
|
- if !userServerData.IsEmpty() {
|
|
|
+ if !userService.IsEmpty() {
|
|
|
//i_status := common.If(dateType == 1, 0, 1)
|
|
|
_, err := g.DB().Ctx(ctx).Update(ctx, "bigmember_service_user", map[string]interface{}{
|
|
|
"l_updatetime": date.NowFormat(date.Date_Full_Layout),
|
|
@@ -227,15 +140,7 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
|
|
|
}
|
|
|
}
|
|
|
case Renew:
|
|
|
- if number > 0 {
|
|
|
- if err := AddPdfPack(p.param.UserId, p.param.UserId, resourceType, endDate.Format(date.Date_Short_Layout), number, 0, entId, 1, pid); err != nil {
|
|
|
- log.Println("AddPdfPack err ", err)
|
|
|
- }
|
|
|
- }
|
|
|
- if !isEquity { //仅赠送pdf
|
|
|
- continue
|
|
|
- }
|
|
|
- if count, _ := g.DB().Ctx(ctx).GetCount(ctx, fmt.Sprintf(`SELECT count(1) FROM bigmember_service_user WHERE s_userid='%s' and s_serviceid=%d`, p.param.UserId, gconv.Int(m["id"]))); count > 0 {
|
|
|
+ if !userService.IsEmpty() {
|
|
|
if status == 1 {
|
|
|
sql1 := fmt.Sprintf("update bigmember_service_user set i_frequency = i_frequency + %v,l_updatetime = %v,l_endtime = %v where s_serviceid = %v and s_userid = %v", frequency, date.NowFormat(date.Date_Full_Layout), endDate, serverId, p.param.UserId)
|
|
|
_, err := g.DB().Ctx(ctx).Exec(ctx, sql1)
|
|
@@ -297,14 +202,6 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
|
|
|
}
|
|
|
|
|
|
case Upgrades:
|
|
|
- if number > 0 {
|
|
|
- if err := AddPdfPack(p.param.UserId, p.param.UserId, resourceType, endDate.Format(date.Date_Short_Layout), number, buyCount, entId, 1, pid); err != nil {
|
|
|
- log.Println("AddPdfPack err ", err)
|
|
|
- }
|
|
|
- }
|
|
|
- if !isEquity { //仅赠送pdf
|
|
|
- continue
|
|
|
- }
|
|
|
if gconv.Int(m["id"]) == 16 {
|
|
|
err := p.UserServiceRecharge(ctx, []string{"12", "13"}, gconv.Int(m["count"]), endDate)
|
|
|
if err != nil {
|
|
@@ -313,9 +210,8 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- count, err := g.DB().Ctx(ctx).GetCount(ctx, fmt.Sprintf(`SELECT count(1) FROM bigmember_service_user WHERE s_serviceid = %s and s_userid = '%s' and i_status = 0 `, fmt.Sprint(serverId), p.param.UserId))
|
|
|
- if count > 0 {
|
|
|
- _, err = g.DB().Ctx(ctx).Exec(ctx, fmt.Sprintf("update bigmember_service_user set i_frequency = i_frequency + %d,l_updatetime = '%s' where s_serviceid = %v and s_userid = '%v' and i_status =0", gconv.Int(m["count"]), date.NowFormat(date.Date_Full_Layout), fmt.Sprint(serverId), p.param.UserId))
|
|
|
+ if !userService.IsEmpty() {
|
|
|
+ _, err := g.DB().Ctx(ctx).Exec(ctx, fmt.Sprintf("update bigmember_service_user set i_frequency = i_frequency + %d,l_updatetime = '%s' where s_serviceid = %v and s_userid = '%v' and i_status =0", gconv.Int(m["count"]), date.NowFormat(date.Date_Full_Layout), fmt.Sprint(serverId), p.param.UserId))
|
|
|
if err != nil {
|
|
|
log.Println("UserServiceRecharge err ", err.Error(), p.param.UserId, serverId)
|
|
|
continue
|
|
@@ -332,12 +228,12 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
|
|
|
"l_createtime": date.NowFormat(date.Date_Full_Layout),
|
|
|
"l_updatetime": date.NowFormat(date.Date_Full_Layout),
|
|
|
}
|
|
|
- _, err = g.DB().Ctx(ctx).Insert(ctx, "bigmember_service_user", insert)
|
|
|
+ _, err := g.DB().Ctx(ctx).Insert(ctx, "bigmember_service_user", insert)
|
|
|
if err != nil {
|
|
|
return errors.New("用户服务表插入失败")
|
|
|
}
|
|
|
}
|
|
|
- err = p.UserServiceRecharge(ctx, []string{gconv.String(serverId)}, gconv.Int(m["count"]), endDate)
|
|
|
+ err := p.UserServiceRecharge(ctx, []string{gconv.String(serverId)}, gconv.Int(m["count"]), endDate)
|
|
|
if err != nil {
|
|
|
log.Println("UserServiceRecharge err ", err.Error(), p.param.UserId, serverId)
|
|
|
}
|
|
@@ -347,9 +243,53 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+func (p jyBigProduct) UserPdfDistribution(ctx context.Context, endDate time.Time, entId, buySubject int, pid int64) error {
|
|
|
+ var (
|
|
|
+ serviceIdArr []string
|
|
|
+ )
|
|
|
+ if p.param.RecordPayType == Upgrades {
|
|
|
+ serviceIdArr = p.param.Filter.SupServiceIds
|
|
|
+ } else {
|
|
|
+ serviceIdArr = p.param.Filter.ServiceIds
|
|
|
+ }
|
|
|
+ serverData, _ := g.DB().Ctx(ctx).Query(ctx, fmt.Sprintf(`SELECT * FROM bigmember_service WHERE id in (%s) `, strings.Join(serviceIdArr, ",")))
|
|
|
+ if !serverData.IsEmpty() {
|
|
|
+ for _, m := range serverData.List() {
|
|
|
+ var (
|
|
|
+ resourceType string
|
|
|
+ number int
|
|
|
+ )
|
|
|
+ //企业补充包不赠送下载报告
|
|
|
+ if strings.Contains(common.InterfaceToStr(m["s_name"]), "市场分析定制报告pdf下载") {
|
|
|
+ resourceType = "市场分析定制报告下载包"
|
|
|
+ } else if strings.Contains(common.InterfaceToStr(m["s_name"]), "业主采购分析报告pdf下载") {
|
|
|
+ resourceType = "业主采购分析报告下载包"
|
|
|
+ } else if strings.Contains(common.InterfaceToStr(m["s_name"]), "企业中标分析报告pdf下载") {
|
|
|
+ resourceType = "企业中标分析报告下载包"
|
|
|
+ }
|
|
|
+ number = common.IntAll(m["s_count_year"])
|
|
|
+ comboId := p.param.Filter.ComboId
|
|
|
+ if comboId > 0 { //套餐 number*时间
|
|
|
+ cycle := p.param.Filter.BuyCycle //购买市场
|
|
|
+ cycleType := p.param.Filter.BuyType //时间类型
|
|
|
+ cycleFmt := common.If(cycleType == 0, 12, 366).(int)
|
|
|
+ number = number * (cycle / cycleFmt)
|
|
|
+ }
|
|
|
+
|
|
|
+ if number > 0 {
|
|
|
+ count := common.If(buySubject == 2, p.param.Filter.FinalAccountCount, 1).(int)
|
|
|
+ if err := AddPdfPack(p.param.UserId, p.param.UserId, resourceType, endDate.Format(date.Date_Short_Layout), number, count, entId, p.param.RecordPayType, pid); err != nil {
|
|
|
+ log.Println("AddPdfPack err ", err)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
// EntEquityUser 企业服务已分配用户
|
|
|
func EntEquityUser(ctx context.Context, waitEmpowerId int) []map[string]interface{} {
|
|
|
- data, err := g.DB().Ctx(ctx).GetAll(ctx, fmt.Sprintf(`SELECT a.ent_id,a.ent_user_id,d.id as pId FROM entniche_power a
|
|
|
+ data, err := g.DB().Ctx(ctx).GetAll(ctx, fmt.Sprintf(`SELECT a.ent_id,a.ent_user_id,d.id as eId FROM entniche_power a
|
|
|
INNER JOIN entniche_user b on a.ent_user_id=b.id
|
|
|
INNER JOIN base_service.base_user c on c.phone = b.phone
|
|
|
INNER JOIN base_service.base_position d on c.id = d.user_id and a.ent_id = d.ent_id
|
|
@@ -409,11 +349,11 @@ func AddPdfPack(userId, accountId, resourceType, endTime string, num, count, ent
|
|
|
return errors.New("addPdfPack error")
|
|
|
}
|
|
|
switch sType {
|
|
|
- case 1:
|
|
|
+ case Buy, try:
|
|
|
jyUrl = "config.SysConfigs.JyResources " + "/resources/entAccountAdd"
|
|
|
- case 2:
|
|
|
+ case Upgrades:
|
|
|
jyUrl = "config.SysConfigs.JyResources" + "/resources/entAccountAdd"
|
|
|
- case 3:
|
|
|
+ case Renew:
|
|
|
jyUrl = "config.SysConfigs.JyResources" + "/resources/entSourceNumAdd"
|
|
|
}
|
|
|
}
|
|
@@ -465,8 +405,8 @@ func CommonPost(path string, param url.Values) (map[string]interface{}, error) {
|
|
|
return resMap, nil
|
|
|
}
|
|
|
|
|
|
-// 企业订阅时间修改
|
|
|
-func UpdateRule(ctx context.Context, entId int, update map[string]interface{}, phone string) bool {
|
|
|
+//UpdateRule 企业订阅时间修改
|
|
|
+/*func UpdateRule(ctx context.Context, entId int, update map[string]interface{}, phone string) bool {
|
|
|
if entId > 0 && phone != "" {
|
|
|
//查找之前数据是否存在
|
|
|
userData, _ := g.DB().Ctx(ctx).GetOne(ctx, fmt.Sprintf(`SELECT * FROM entniche_user WHERE ent_id =%d and phone ='%s'`, entId, phone))
|
|
@@ -538,8 +478,8 @@ func UpdateRule(ctx context.Context, entId int, update map[string]interface{}, p
|
|
|
if len(up1) > 0 {
|
|
|
query := bson.M{
|
|
|
"$or": []bson.M{
|
|
|
- bson.M{"i_vip_status": bson.M{"$gt": 0}},
|
|
|
- bson.M{"i_member_status": bson.M{"$gt": 0}},
|
|
|
+ {"i_vip_status": bson.M{"$gt": 0}},
|
|
|
+ {"i_member_status": bson.M{"$gt": 0}},
|
|
|
},
|
|
|
"i_entid": entId,
|
|
|
"i_userid": userData.Map()["id"],
|
|
@@ -556,26 +496,16 @@ func UpdateRule(ctx context.Context, entId int, update map[string]interface{}, p
|
|
|
return ok1 || ok2
|
|
|
}
|
|
|
return false
|
|
|
-}
|
|
|
+}*/
|
|
|
|
|
|
func GetBigMemberProductTypeByOrderCode(level int) string {
|
|
|
- var product_type = "大会员"
|
|
|
- //1:专业版;2:智慧版;3:商机版;4:试用版 5:试用版 6:商机版2.0 7:专家版2.0
|
|
|
- switch level {
|
|
|
- case 1:
|
|
|
- product_type += "专家版"
|
|
|
- case 2:
|
|
|
- product_type += "智慧版"
|
|
|
- case 3:
|
|
|
- product_type += "商机版"
|
|
|
- case 4:
|
|
|
- product_type += "试用版"
|
|
|
- case 6:
|
|
|
- product_type += "商机版2.0"
|
|
|
- case 7:
|
|
|
- product_type += "专家版2.0"
|
|
|
- default:
|
|
|
- product_type += "自定义"
|
|
|
+ productType := "大会员自定义"
|
|
|
+ if level < 0 || level == 5 {
|
|
|
+ return productType
|
|
|
+ }
|
|
|
+ comboData, _ := g.DB().Ctx(context.Background()).GetOne(context.Background(), fmt.Sprintf(`SELECT s_name,s_servers FROM bigmember_combo WHERE id=%d`, level))
|
|
|
+ if !comboData.IsEmpty() {
|
|
|
+ return fmt.Sprintf("大会员%s", gconv.String(comboData.Map()["s_name"]))
|
|
|
}
|
|
|
- return product_type
|
|
|
+ return productType
|
|
|
}
|