Browse Source

fix:提交

duxin 4 months ago
parent
commit
89af397406

+ 2 - 1
go.mod

@@ -1,6 +1,7 @@
 module jyOrderManager
 
-go 1.18
+go 1.21
+
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20250220061341-81c668b6c7ea

+ 17 - 17
internal/cmd/cmd.go

@@ -35,34 +35,34 @@ var (
 					group.GET("/getSalesList", controller.GetSalesListHandler)                //获取销售人员列表
 					group.POST("/getAccountVipStatus", controller.GetAccountVipStatusHandler) //获取账户会员状态
 					group.POST("/userService", controller.GetUserService)                     //获取账户大会员服务
-					group.POST("/getSalesChannelItem", controller.GetSalesChannelItem)        //销售区点&0原订单类型
+					group.GET("/getSalesChannelItem", controller.GetSalesChannelItem)         //销售区点&0原订单类型
 				})
 
 				//产品相关
 				group.Group("/product", func(group *ghttp.RouterGroup) {
 					group.GET("/list", controller.GetProductListHandler)          //商品表列表
 					group.POST("/getPrice", controller.GetProductPriceHandler)    //获取价格
-					group.POST("/bigMember/service", controller.BigMemberService) //大会员服务
+					group.GET("/bigMember/service", controller.BigMemberService) //大会员服务
 
 				})
 
 				//订单相关
 				group.Group("/order", func(group2 *ghttp.RouterGroup) {
-					group.POST("/save", controller.SaveOrderHandler)                     //创建订单
-					group.POST("/update", controller.UpdateOrderHandler)                 //修改订单
-					group.GET("/examine", controller.Examine)                            //订单审核
-					group.GET("/list", controller.OrderList)                             //订单列表
-					group.GET("/examineList", controller.OrderExamineList)               //审核订单列表
-					group.GET("/detail", controller.OrderDetail)                         //订单详情
-					group.GET("/cancellation", controller.OrderCancellation)             //订单作废
-					group.GET("/editBatchReturn", controller.OrderEditBatchReturn)       //订单回款
-					group.GET("/orderRedPunch", controller.OrderRedPunch)                //订单红冲
-					group.GET("/refund", controller.OrderRefund)                         //订单退款
-					group.GET("/seal", controller.OrderSeal)                             //订单盖章
-					group.GET("/uploadContractFile", controller.OrderUploadContractFile) //订单上传协议
-					group.GET("/upload", controller.OrderUpload)                         //订单协议归档
-					group.GET("/selfInvoice", controller.OrderSelfInvoice)               //订单自助开票
-					group.GET("/transferAccounts", controller.TransferAccounts)          //对公转行审核
+					group.POST("/save", controller.SaveOrderHandler)                      //创建订单
+					group.POST("/update", controller.UpdateOrderHandler)                  //修改订单
+					group.POST("/examine", controller.Examine)                            //订单审核
+					group.POST("/list", controller.OrderList)                             //订单列表
+					group.POST("/examineList", controller.OrderExamineList)               //审核订单列表
+					group.POST("/detail", controller.OrderDetail)                         //订单详情
+					group.POST("/cancellation", controller.OrderCancellation)             //订单作废
+					group.POST("/editBatchReturn", controller.OrderEditBatchReturn)       //订单回款
+					group.POST("/orderRedPunch", controller.OrderRedPunch)                //订单红冲
+					group.POST("/refund", controller.OrderRefund)                         //订单退款
+					group.POST("/seal", controller.OrderSeal)                             //订单盖章
+					group.POST("/uploadContractFile", controller.OrderUploadContractFile) //订单上传协议
+					group.POST("/upload", controller.OrderUpload)                         //订单协议归档
+					group.POST("/selfInvoice", controller.OrderSelfInvoice)               //订单自助开票
+					//group.POST("/transferAccounts", controller.TransferAccounts)          //对公转行审核
 
 					//业绩相关
 					group2.Group("/saleRecord", func(group3 *ghttp.RouterGroup) {

+ 1 - 5
internal/controller/getSalesChannelItem.go

@@ -11,11 +11,7 @@ import (
 // GetSalesChannelItem 销售区点&0原订单类型
 func GetSalesChannelItem(r *ghttp.Request) {
 	rData, err := func() (interface{}, error) {
-		value, err := r.Session.Get("entUserId")
-		if err != nil {
-			return nil, err
-		}
-		list, err := order.SalesChannelItem(r.Context(), value.Int())
+		list, err := order.SalesChannelItem(r.Context())
 		if err != nil {
 			return nil, errors.Wrap(err, "销售区点&0原订单类型异常")
 		}

+ 1 - 5
internal/controller/orderExamineList.go

@@ -18,11 +18,7 @@ func OrderExamineList(r *ghttp.Request) {
 		if err != nil {
 			return nil, errors.Wrap(err, "数据校验异常")
 		}
-		value, err := r.Session.Get("entUserId")
-		if err != nil || value.Int() <= 0 {
-			return nil, errors.New("userid err")
-		}
-		list, err := order.ExamineList(r.Context(), param, value.Int())
+		list, err := order.ExamineList(r.Context(), param)
 		if err != nil {
 			return nil, errors.Wrap(err, "订单创建异常")
 		}

+ 1 - 1
internal/controller/orderList.go

@@ -22,7 +22,7 @@ func OrderList(r *ghttp.Request) {
 		if err != nil || value.Int() <= 0 {
 			return nil, errors.New("userid err")
 		}
-		list, err := order.List(r.Context(), param, value.Int())
+		list, err := order.List(r.Context(), param)
 		if err != nil {
 			return nil, errors.Wrap(err, "订单list异常")
 		}

+ 2 - 2
internal/controller/returnOnlineHandler.go

@@ -77,8 +77,8 @@ func GetReturnOnlineHandler(r *ghttp.Request) {
 				"token":        token,
 				"order_code":   orderCode,
 				"return_money": money,
-				"expire_time":  targetTime.Format(time.DateTime),
-				"creat_time":   now.Format(time.DateTime),
+				"expire_time":  targetTime.Format("2006-01-02 15:04:05"),
+				"creat_time":   now.Format("2006-01-02 15:04:05"),
 			}); err != nil {
 				return nil, gerror.Wrapf(err, "保存回款数据异常")
 			}

+ 1 - 1
internal/jyutil/util.go

@@ -8,7 +8,7 @@ func StrToTime(tm string, format ...string) (effectiveDate time.Time) {
 	if len(format) > 0 {
 		effectiveDate, _ = time.ParseInLocation(format[0], tm, time.Local)
 	} else {
-		effectiveDate, _ = time.ParseInLocation(time.DateTime, tm, time.Local)
+		effectiveDate, _ = time.ParseInLocation("2006-01-02 15:04:05", tm, time.Local)
 	}
 	return
 }

+ 8 - 7
internal/logic/middleware/middleware.go

@@ -87,13 +87,14 @@ func (s *sMiddleware) Log(r *ghttp.Request) {
 // LoginFilter 登录过滤拦截
 func (s *sMiddleware) LoginFilter(r *ghttp.Request) {
 	uMsg := model.User{
-		PositionId: r.Session.MustGet("positionId", 0).Int64(),
-		EntUserId:  r.Session.MustGet("entUserId", 0).Int64(),
-		EntId:      r.Session.MustGet("entId", 0).Int64(),
-		EntDeptId:  r.Session.MustGet("entDeptId", 0).Int64(),
-		EntRole:    r.Session.MustGet("entRole", 0).Int64(),
-		AccountId:  r.Session.MustGet("accountId", 0).Int64(),
-		MgoUserId:  r.Session.MustGet("mgoUserId", 0).String(),
+		PositionId:  r.Session.MustGet("positionId", 0).Int64(),
+		EntUserId:   r.Session.MustGet("entUserId", 0).Int64(),
+		EntId:       r.Session.MustGet("entId", 0).Int64(),
+		EntDeptId:   r.Session.MustGet("entDeptId", 0).Int64(),
+		EntRole:     r.Session.MustGet("entRole", 0).Int64(),
+		AccountId:   r.Session.MustGet("accountId", 0).Int64(),
+		MgoUserId:   r.Session.MustGet("mgoUserId", 0).String(),
+		EntUserName: r.Session.MustGet("entUserName", 0).String(),
 	}
 	if uMsg.EntId == 0 || uMsg.EntUserId == 0 {
 		r.SetError(fmt.Errorf("身份异常"))

+ 3 - 5
internal/logic/order/detail.go

@@ -43,7 +43,6 @@ func Detail(ctx context.Context, param model.OrderDetailParams) (map[string]inte
 				m["activityName"] = gconv.String(activityData.Map()["name"])
 			}
 		}
-
 		if linkedDetailId := gconv.String(m["linked_detail_id"]); linkedDetailId != "" {
 			var orderArr []map[string]interface{}
 			//关联订单
@@ -82,7 +81,7 @@ WHERE a.status = 1 and a.is_service_open = 1 and b.user_id = '%s' and a.product_
 						if common.IntAll((*buySet)["upgrade"]) == 1 {
 							//newVip = true
 						}
-						endTime = time.Unix(common.Int64All((*userData)["l_vip_endtime"]), 0).Format(time.DateTime)
+						endTime = time.Unix(common.Int64All((*userData)["l_vip_endtime"]), 0).Format("2006-01-02 15:04:05")
 
 					case "大会员":
 						bigStart := common.Int64All((*userData)["i_member_starttime"])
@@ -92,11 +91,10 @@ WHERE a.status = 1 and a.is_service_open = 1 and b.user_id = '%s' and a.product_
 							areaCount = common.IntAll(memberJyMap["i_areacount"])
 						}
 						if bigStart >= time.Now().Unix() {
-							endTime = time.Unix(bigEnd, 0).Format(time.DateTime)
+							endTime = time.Unix(bigEnd, 0).Format("2006-01-02 15:04:05")
 						} else if (time.Now().Unix() < bigEnd && memberStatus > 0) || bigStart >= time.Now().Unix() {
-							endTime = time.Unix(bigEnd, 0).Format(time.DateTime)
+							endTime = time.Unix(bigEnd, 0).Format("2006-01-02 15:04:05")
 						}
-
 						paySubNum = common.IntAll((*userData)["i_pay_sub_num"]) + common.IntAll((*userData)["i_free_sub_num"]) + 1
 					}
 					m["linkedOrder"] = map[string]interface{}{

+ 6 - 6
internal/logic/order/examine.go

@@ -170,7 +170,7 @@ func OrdersExamine(ctx context.Context, param model.OrdersExamine) error {
 		//插入审核记录表
 		tn := time.Now()
 		insertData := map[string]interface{}{
-			"operator":      "", //审核操作人
+			"operator":      jyutil.GetUserMsgFromCtx(ctx).EntUserName, //审核操作人
 			"create_time":   tn.Format(date.Date_Full_Layout),
 			"operator_type": operatorType,
 			"audit_status":  auditStatus,
@@ -186,8 +186,8 @@ func OrdersExamine(ctx context.Context, param model.OrdersExamine) error {
 		if checkAuto {
 			// 给定的数据
 			columns := strings.Split("operator,create_time,operator_type,audit_status,back_reason,order_code,audit_type", ",")
-			values := []interface{}{"系统自动", time.Now().Add(time.Second).Format(time.DateTime), 3, OrderSecondPassed, "系统自动审核通过", param.OrderCode, 2,
-				"系统自动", time.Now().Add(2 * time.Second).Format(time.DateTime), 5, OrderPassed, "系统自动审核通过", param.OrderCode, 2}
+			values := []interface{}{"系统自动", time.Now().Add(time.Second).Format("2006-01-02 15:04:05"), 3, OrderSecondPassed, "系统自动审核通过", param.OrderCode, 2,
+				"系统自动", time.Now().Add(2 * time.Second).Format("2006-01-02 15:04:05"), 5, OrderPassed, "系统自动审核通过", param.OrderCode, 2}
 
 			// 构建SQL插入语句
 			query := fmt.Sprintf("INSERT INTO audit_records (%s) VALUES (?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?)", strings.Join(columns, ","))
@@ -340,7 +340,7 @@ func CheckAutoAudit(ctx context.Context, orderData map[string]interface{}, produ
 			return false
 		}
 		conditionalStr, _ := json.Marshal(conditionalMap)
-		insertData = append(insertData, fmt.Sprintf(`('%s',%f,%f,%f,%s,'%s',%d,'%s')`, time.Now().Format(time.DateTime), gconv.Float64(m["final_price"]), gconv.Float64(m["original_price"]),
+		insertData = append(insertData, fmt.Sprintf(`('%s',%f,%f,%f,%s,'%s',%d,'%s')`, time.Now().Format("2006-01-02 15:04:05"), gconv.Float64(m["final_price"]), gconv.Float64(m["original_price"]),
 			common.Float64All(m["final_price"])/common.Float64All(m["original_price"]), common.InterfaceToStr(m["order_code"]),
 			common.InterfaceToStr(m["product_type"]), monthCount, string(conditionalStr)))
 
@@ -358,7 +358,7 @@ func CheckAutoAudit(ctx context.Context, orderData map[string]interface{}, produ
 			for _, datum := range activityData { //同种活动 统一计算折扣率
 				activityOriginalPrice += gconv.Float64(datum["original_price"])
 				activityClosingPrice += gconv.Float64(datum["final_price"])
-				activityInsertData = append(activityInsertData, fmt.Sprintf(`('%s',%f,%f,%f,%s,'%s',%d,'%s')`, time.Now().Format(time.DateTime), gconv.Float64(datum["final_price"]), gconv.Float64(datum["original_price"]),
+				activityInsertData = append(activityInsertData, fmt.Sprintf(`('%s',%f,%f,%f,%s,'%s',%d,'%s')`, time.Now().Format("2006-01-02 15:04:05"), gconv.Float64(datum["final_price"]), gconv.Float64(datum["original_price"]),
 					common.Float64All(datum["final_price"])/common.Float64All(datum["original_price"]), common.InterfaceToStr(datum["order_code"]),
 					common.InterfaceToStr(datum["product_type"]), -1, fmt.Sprintf("活动产品:活动id:%s 活动折扣率:%f", activityCode, gconv.Float64(activity.Map()["rate"]))))
 			}
@@ -419,7 +419,7 @@ WHERE e.order_detail_id = %s`, orderId))
 			return monthCount
 		}
 		var startTime, endTime time.Time
-		startTime = jyutil.StrToTime(gconv.String(waitEmpower.Map()["start_time"]), time.DateTime)
+		startTime = jyutil.StrToTime(gconv.String(waitEmpower.Map()["start_time"]), "2006-01-02 15:04:05")
 		endTime = time.Unix(common.Int64All(waitEmpower.Map()["end_time"]), 0).Local()
 		if startTime.Unix() < time.Now().Unix() {
 			startTime = time.Now()

+ 2 - 1
internal/logic/order/examineList.go

@@ -29,12 +29,13 @@ func StatusRights(id int) int {
 	return equity
 }
 
-func ExamineList(ctx context.Context, param model.OrderExamineListParams, adminId int) (map[string]interface{}, error) {
+func ExamineList(ctx context.Context, param model.OrderExamineListParams) (map[string]interface{}, error) {
 	var (
 		condition = []string{
 			"is_backstage_order=1",
 		}
 		innerSale = ""
+		adminId   = gconv.Int(jyutil.GetUserMsgFromCtx(ctx).EntUserId)
 	)
 	equity := StatusRights(adminId)
 	if param.SaleDep != "" {

+ 3 - 1
internal/logic/order/list.go

@@ -6,14 +6,16 @@ import (
 	"fmt"
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/util/gconv"
+	"jyOrderManager/internal/jyutil"
 	"jyOrderManager/internal/model"
 	"log"
 	"strings"
 )
 
-func List(ctx context.Context, param model.OrderListParams, adminId int) (map[string]interface{}, error) {
+func List(ctx context.Context, param model.OrderListParams) (map[string]interface{}, error) {
 	var (
 		orderSql []string
+		adminId  = jyutil.GetUserMsgFromCtx(ctx).PositionId
 	)
 
 	if param.Page <= 0 {

+ 1 - 1
internal/logic/order/returnPlant.go

@@ -56,7 +56,7 @@ func SaveOrUpdateReturnPlant(ctx context.Context, orderCode string, orderMoney i
 			return gerror.Wrap(err, "更新回款计划异常")
 		}
 	} else { //新增
-		data["create_time"] = time.Now().Format(time.DateTime)
+		data["create_time"] = time.Now().Format("2006-01-02 15:04:05")
 		if _, err := g.DB().Save(ctx, "return_money_plant", data); err != nil {
 			return gerror.Wrap(err, "保存回款计划异常")
 		}

+ 4 - 4
internal/logic/order/saleRecord.go

@@ -73,7 +73,7 @@ var saleSaveRecordTmp = func(ctx context.Context, orderCode, createPerson string
 	var (
 		saveList []map[string]interface{}
 		uuid     = uuid2.New().String()
-		now      = time.Now().Local().Format(time.DateTime)
+		now      = time.Now().Local().Format("2006-01-02 15:04:05")
 	)
 	for _, s := range record {
 		deptId, deptName, userName, err := jyutil.JyDepartmentManager.GetDeptInfoByEntId(ctx, s.Id)
@@ -186,7 +186,7 @@ func OrderMoneyMakeRed(ctx context.Context, orderCode string, final int64) error
 
 	var (
 		newUUid = uuid2.New().String()
-		nowTime = time.Now().Local().Format(time.DateTime)
+		nowTime = time.Now().Local().Format("2006-01-02 15:04:05")
 	)
 	for _, m := range emptyMoneyRow {
 		m["last_group_uuid"] = m["group_uuid"]
@@ -302,7 +302,7 @@ func OrderSalerChange(ctx context.Context, newSales []*model.SalesMoney, orderCo
 	var (
 		saveList []map[string]interface{}
 		newUUid  = uuid2.New().String()
-		nowTime  = time.Now().Local().Format(time.DateTime)
+		nowTime  = time.Now().Local().Format("2006-01-02 15:04:05")
 		insertEd = map[int]bool{}
 	)
 	for _, row := range newSales {
@@ -411,7 +411,7 @@ func CommonChange(ctx context.Context, orderCode, operationTime string, operatio
 		reason = "协议归档"
 	}
 	if affectTime == "" {
-		affectTime = time.Now().Local().Format(time.DateTime)
+		affectTime = time.Now().Local().Format("2006-01-02 15:04:05")
 	}
 	if err := TakeEffectSale(ctx, orderCode, reason, affectTime); err != nil {
 		log.Printf("TakeEffectSale %d %s失败 %v", operationType, orderCode, err)

+ 5 - 51
internal/logic/order/salesChannelItem.go

@@ -9,8 +9,9 @@ import (
 	"jyOrderManager/internal/jyutil"
 )
 
-func SalesChannelItem(ctx context.Context, adminId int) (map[string]interface{}, error) {
-	item, _ := g.DB().Query(ctx, `SELECT item_code,item_name FROM dict_item WHERE parent_name ='parent_name' and state=1`)
+func SalesChannelItem(ctx context.Context) (map[string]interface{}, error) {
+	adminId := jyutil.GetUserMsgFromCtx(ctx).EntUserId
+	item, _ := g.DB().Query(ctx, `SELECT item_code,item_name FROM dict_item WHERE parent_name ='销售渠道' and state=1`)
 	var res []map[string]interface{}
 	if !item.IsEmpty() {
 
@@ -22,54 +23,7 @@ func SalesChannelItem(ctx context.Context, adminId int) (map[string]interface{},
 			}
 		}
 	}
-	//dep := []map[string]interface{}{}
-	//data := config.JysqlDB.SelectBySql(`select * from dict_dep WHERE status = 1`)
-	//if data != nil && len(*data) > 0 {
-	//	for _, v := range *data {
-	//		code := common.ObjToString(v["code"])
-	//		name := common.ObjToString(v["name"])
-	//		level := common.ObjToString(v["level"])
-	//		if level == "1" {
-	//			depMap := map[string]interface{}{"value": code, "label": name}
-	//			datas := config.JysqlDB.SelectBySql(`select * from dict_dep where status = 1 and parentCode = "` + code + `"`)
-	//			if datas != nil && len(*datas) > 0 {
-	//				children := []map[string]interface{}{}
-	//				for _, vv := range *datas {
-	//					codes := common.ObjToString(vv["code"])
-	//					names := common.ObjToString(vv["name"])
-	//					childrenMap := map[string]interface{}{"value": codes, "label": names}
-	//					datass := config.JysqlDB.SelectBySql(`select * from dict_dep where status = 1 and parentCode = "` + codes + `"`)
-	//					if datass != nil && len(*datass) > 0 {
-	//						childrens := []map[string]interface{}{}
-	//						for _, vvv := range *datass {
-	//							codess := common.ObjToString(vvv["code"])
-	//							namess := common.ObjToString(vvv["name"])
-	//							childrens = append(childrens, map[string]interface{}{"value": codess, "label": namess})
-	//						}
-	//						if len(childrens) > 0 {
-	//							childrenMap["children"] = childrens
-	//						}
-	//					}
-	//					children = append(children, childrenMap)
-	//				}
-	//				if len(children) > 0 {
-	//					depMap["children"] = children
-	//				}
-	//			}
-	//			dep = append(dep, depMap)
-	//		}
-	//	}
-	//}
-	//  `distribution_channel` varchar(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '销售渠道',
-	//  `salesperson_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '销售人员在剑鱼后台的用户id',
-	//  `saleDep` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '040000' COMMENT '业绩归属部门:010000',
-	//获取最近一次业绩归属部门 下单渠道 销售人员在剑鱼后台的用户id
-	//displayMap := make(map[string]interface{})
-	//displayData := config.JysqlDB.SelectBySql(`SELECT distribution_channel FROM dataexport_order a WHERE a.create_person = ?  ORDER BY a.create_time DESC LIMIT 1`, context.User.Username)
-	//if displayData != nil && len(*displayData) > 0 {
-	//	display := (*displayData)[0]
-	//	displayMap["distribution_channel"] = display["distribution_channel"]
-	//}
+
 	displayMap := make(map[string]interface{})
 	for deptId, channelCode := range g.Cfg().MustGet(gctx.New(), "deptDefaultChannel").Map() {
 		displayMap[deptId] = channelCode
@@ -79,7 +33,7 @@ func SalesChannelItem(ctx context.Context, adminId int) (map[string]interface{},
 	}
 
 	userDep := make(map[string]interface{})
-	equity := StatusRights(adminId)
+	equity := StatusRights(gconv.Int(adminId))
 	if equity == 1 { //部门经理
 		deptId, deptName, _, err := jyutil.GetDeptInfoByAdminId(adminId)
 		if err == nil {

+ 0 - 4
internal/logic/order/transferAccounts.go

@@ -29,10 +29,6 @@ func TransferAccounts(ctx context.Context, param model.TransferAccountsParams) (
 		"course_status": course_status,
 		"pay_money":     pay_money,
 	}, qMap)
-	_, _ = g.DB().Update(ctx, "jy_order_transfer", map[string]interface{}{
-		"course_status": course_status,
-		"price":         pay_money,
-	}, qMap)
 
 	if course_status == 4 {
 		r, err := rpc.DialHTTP("tcp", g.Cfg().MustGet(context.Background(), "jyPayRpc").String())

+ 2 - 1
internal/logic/product/bigmember/BigMemberBuyTry.go

@@ -18,8 +18,9 @@ import (
 )
 
 func (p jyBigProduct) NewBigOpenService(ctx context.Context, startDate, endDate time.Time, buyCount, buySubject, entId int, pid int64) error {
+	cycle := common.If(p.param.Filter.ComboId == 0, 5, p.param.Filter.ComboId).(int)
 	sets := map[string]interface{}{
-		"i_member_status":      common.If(startDate.Unix() <= time.Now().Unix(), p.param.Filter.ComboId, -p.param.Filter.ComboId),
+		"i_member_status":      common.If(startDate.Unix() <= time.Now().Unix(), cycle, -cycle),
 		"i_member_starttime":   startDate.Unix(),
 		"i_member_endtime":     endDate.Unix(),
 		"i_mainaccount":        1,

+ 3 - 3
internal/logic/product/bigmember/BigMemberRenew.go

@@ -72,7 +72,7 @@ func (p jyBigProduct) BigEntMemberExtend(ctx context.Context, waitEmpowerId int,
 		}
 	}
 	if len(entUserId) > 0 {
-		upSql := fmt.Sprintf(`"update bigmember_service_user set l_updatetime = '%s',l_starttime = '%s',l_endtime = '%s' where  s_userid in ('%s')"`, time.Now().Format(time.DateTime), startTime.Format(time.DateTime), endTime.Format(time.DateTime), strings.Join(entUserId, `','"`))
+		upSql := fmt.Sprintf(`"update bigmember_service_user set l_updatetime = '%s',l_starttime = '%s',l_endtime = '%s' where  s_userid in ('%s')"`, time.Now().Format("2006-01-02 15:04:05"), startTime.Format("2006-01-02 15:04:05"), endTime.Format("2006-01-02 15:04:05"), strings.Join(entUserId, `','"`))
 		log.Println("BigEntMemberExtend update bigmember_service_user sql:", upSql)
 		g.DB().Exec(ctx, upSql)
 	}
@@ -130,10 +130,10 @@ INNER JOIN entniche_order b on a.id = b.order_detail_id
 INNER JOIN entniche_wait_empower c on b.wait_empower_id=c.id
 where a.id = %d  `, p.param.LinkedOrderId))
 		if !data.IsEmpty() {
-			eTime := jyutil.StrToTime(gconv.String(data.Map()["eTime"]), time.DateTime)
+			eTime := jyutil.StrToTime(gconv.String(data.Map()["eTime"]), "2006-01-02 15:04:05")
 			if eTime.Unix() > time.Now().Unix() {
 				newEndTime = eTime
-				newStartTime = jyutil.StrToTime(gconv.String(data.Map()["sTime"]), time.DateTime)
+				newStartTime = jyutil.StrToTime(gconv.String(data.Map()["sTime"]), "2006-01-02 15:04:05")
 			} else {
 				newEndTime = time.Now()
 				newStartTime = time.Now()

+ 5 - 5
internal/logic/product/bigmember/BigMemberUpgrades.go

@@ -40,8 +40,8 @@ where a.id = %d  `, p.param.LinkedOrderId))
 			if data.IsEmpty() {
 				return errors.New("套餐id获取失败")
 			}
-			newStartTime = jyutil.StrToTime(gconv.String(data.Map()["eTime"]), time.DateTime)
-			newEndTime = jyutil.StrToTime(gconv.String(data.Map()["sTime"]), time.DateTime)
+			newStartTime = jyutil.StrToTime(gconv.String(data.Map()["eTime"]), "2006-01-02 15:04:05")
+			newEndTime = jyutil.StrToTime(gconv.String(data.Map()["sTime"]), "2006-01-02 15:04:05")
 			waitEmpowerId = gconv.Int(data["waitEmpowerId"])
 			entId = gconv.Int(data["ent_id"])
 			productDetail.ServiceStartTime = newStartTime
@@ -81,7 +81,7 @@ func (p jyBigProduct) BigMemberSub(ctx context.Context, orderData, userData map[
 		bigEnd := common.Int64All(userData["i_member_endtime"])
 		buyCount = p.param.Filter.BuyAccountCount + p.param.Filter.GiftAccountCount + gconv.Int(userData["i_pay_sub_num"])
 		productDetail.ServiceStartTime = time.Now()
-		productDetail.ServiceEndTime = jyutil.StrToTime(gconv.String(bigEnd), time.DateTime)
+		productDetail.ServiceEndTime = jyutil.StrToTime(gconv.String(bigEnd), "2006-01-02 15:04:05")
 		if !jyutil.MG.DB().UpdateById("user", p.param.UserId, map[string]interface{}{
 			"$set": map[string]interface{}{
 				"i_pay_sub_num": buyCount,
@@ -94,8 +94,8 @@ func (p jyBigProduct) BigMemberSub(ctx context.Context, orderData, userData map[
 				_, err := g.DB().Insert(ctx, "bigmember_service_user", map[string]interface{}{
 					"s_userid":     p.param.UserId,
 					"s_serviceid":  2,
-					"l_starttime":  time.Unix(bigStart, 0).Format(time.DateTime),
-					"l_endtime":    time.Unix(bigEnd, 0).Format(time.DateTime),
+					"l_starttime":  time.Unix(bigStart, 0).Format("2006-01-02 15:04:05"),
+					"l_endtime":    time.Unix(bigEnd, 0).Format("2006-01-02 15:04:05"),
 					"i_status":     0,
 					"l_createtime": date.NowFormat(date.Date_Full_Layout),
 					"l_updatetime": date.NowFormat(date.Date_Full_Layout),

+ 43 - 27
internal/logic/product/bigmember/bigcommon.go

@@ -13,6 +13,7 @@ import (
 	"io/ioutil"
 	"jyOrderManager/internal/jyutil"
 	"log"
+	"math"
 	"net/http"
 	"net/url"
 	"strings"
@@ -44,6 +45,14 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
 	var serviceIdArr []string
 	if p.param.ServiceType == Upgrades {
 		serviceIdArr = p.param.Filter.SupServiceIds
+		class, _ := g.DB().Ctx(ctx).GetCount(ctx, fmt.Sprintf(`SELECT i_class FROM bigmember_service WHERE id in (%s) `, strings.Join(serviceIdArr, ",")))
+		if class > 0 { //升级有结构化数据 重置老权益
+			sql1 := fmt.Sprintf("update bigmember_service_user set i_status =-1,l_updatetime = %v where s_userid ='%s' and s_serviceid in (SELECT id FROM bigmember_service WHERE i_class = 4)", date.NowFormat(date.Date_Full_Layout), p.param.UserId)
+			_, err := g.DB().Ctx(ctx).Exec(ctx, sql1)
+			if err != nil {
+				log.Println("升级结构化数据 重置权益err", err)
+			}
+		}
 	} else {
 		serviceIdArr = p.param.Filter.ServiceIds
 	}
@@ -61,10 +70,11 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
 			case 11:
 				frequency = p.param.Filter.BuyCycle * common.IntAll(m["s_count_month"])
 			case 15:
-				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"]))
+				cycle := month(p.param.Filter.BuyCycle, p.param.Filter.BuyType) + month(p.param.Filter.GiftCycle, p.param.Filter.GiftType)
+				if cycle >= 12 {
+					frequency = (cycle / 12 * common.IntAll(m["s_count_year"])) + (cycle % 12 * common.IntAll(m["s_count_month"]))
 				} else {
-					frequency = p.param.Filter.BuyCycle * common.IntAll(m["s_count_month"])
+					frequency = cycle * common.IntAll(m["s_count_month"])
 				}
 			default:
 				frequency = common.IntAll(m["s_count_month"])
@@ -173,31 +183,22 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
 					}
 					continue
 				}
-
-				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
-					}
-				} else {
-					insert := map[string]interface{}{
-						"s_userid":     p.param.UserId,
-						"s_smainid":    mainId,
-						"s_serviceid":  serverId,
-						"i_frequency":  frequency,
-						"l_starttime":  date.FormatDate(&startDate, date.Date_Full_Layout),
-						"l_endtime":    date.FormatDate(&endDate, date.Date_Full_Layout),
-						"i_status":     status,
-						"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)
-					if err != nil {
-						return errors.New("用户服务表插入失败")
-					}
+				insert := map[string]interface{}{
+					"s_userid":     p.param.UserId,
+					"s_smainid":    mainId,
+					"s_serviceid":  serverId,
+					"i_frequency":  frequency,
+					"l_starttime":  date.FormatDate(&startDate, date.Date_Full_Layout),
+					"l_endtime":    date.FormatDate(&endDate, date.Date_Full_Layout),
+					"i_status":     status,
+					"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)
+				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)
 				}
@@ -207,6 +208,21 @@ func (p jyBigProduct) UserEquityDistribution(ctx context.Context, startDate, end
 	return nil
 }
 
+func month(num, ty int) int {
+	//BuyType    int      `json:"buy_type"`   //购买周期 类型 1天 2月 3年 4季度
+	switch ty {
+	case 2:
+		return num
+	case 1:
+		return gconv.Int(math.Ceil(float64(num) / 30))
+	case 3:
+		return num * 12
+	case 4:
+		return num * 3
+	}
+	return 0
+}
+
 func (p jyBigProduct) UserPdfDistribution(ctx context.Context, endDate time.Time, entId, buySubject int, pid int64) error {
 	var (
 		serviceIdArr []string

+ 5 - 5
internal/logic/product/bigmember/bigmember.go

@@ -173,8 +173,8 @@ func (p jyBigProduct) SaveUpdate(ctx context.Context, masterKey string) error {
 			}
 			filter.FinalAreaCount = sVal.UnitNum
 		}
-		newData["service_starttime"] = startTime.Format(time.DateTime)
-		newData["service_endtime"] = endTime.Format(time.DateTime)
+		newData["service_starttime"] = startTime.Format("2006-01-02 15:04:05")
+		newData["service_endtime"] = endTime.Format("2006-01-02 15:04:05")
 	}
 	newData["filter"] = gconv.String(filter)
 	if gconv.Int(p.param.Id) > 0 {
@@ -252,9 +252,9 @@ func (p jyBigProduct) OpenService(ctx context.Context) error {
 	jyutil.ClearBigVipUserPower(ctx, productDetail.UserId)
 	//更新订单明细
 	_, err = g.DB().Update(ctx, consts.OrderDetailTableName, g.Map{
-		"service_starttime": productDetail.ServiceStartTime.Format(time.DateTime),
-		"service_endtime":   productDetail.ServiceEndTime.Format(time.DateTime),
-		"open_service_time": time.Now().Format(time.DateTime),
+		"service_starttime": productDetail.ServiceStartTime.Format("2006-01-02 15:04:05"),
+		"service_endtime":   productDetail.ServiceEndTime.Format("2006-01-02 15:04:05"),
+		"open_service_time": time.Now().Format("2006-01-02 15:04:05"),
 		"is_service_open":   1,
 	}, "id=?", p.param.Id)
 	if err != nil {

+ 4 - 4
internal/logic/product/common.go

@@ -32,11 +32,11 @@ func GetLinkVipCycleFilter(ctx context.Context, linkOrderDetailId int64) (filter
 	if err != nil {
 		return
 	}
-	st, err = time.Parse(time.DateTime, gconv.String(dMap["service_starttime"]))
+	st, err = time.Parse("2006-01-02 15:04:05", gconv.String(dMap["service_starttime"]))
 	if err != nil {
 		return
 	}
-	et, err = time.Parse(time.DateTime, gconv.String(dMap["service_endtime"]))
+	et, err = time.Parse("2006-01-02 15:04:05", gconv.String(dMap["service_endtime"]))
 	if err != nil {
 		return
 	}
@@ -63,11 +63,11 @@ func GetLinkBigCycleFilter(ctx context.Context, linkOrderDetailId int64) (filter
 	if err != nil {
 		return
 	}
-	st, err = time.Parse(time.DateTime, gconv.String(dMap["service_starttime"]))
+	st, err = time.Parse("2006-01-02 15:04:05", gconv.String(dMap["service_starttime"]))
 	if err != nil {
 		return
 	}
-	et, err = time.Parse(time.DateTime, gconv.String(dMap["service_endtime"]))
+	et, err = time.Parse("2006-01-02 15:04:05", gconv.String(dMap["service_endtime"]))
 	if err != nil {
 		return
 	}

+ 6 - 6
internal/logic/product/dataPack/service.go

@@ -69,13 +69,13 @@ func (p jyDataPackProduct) OpenService(ctx context.Context) error {
 	}
 
 	_, err = middleGround.CommonPost(middleGround.JyApiConfig.ApiList.BuyBalance, url.Values{
-		"accountId":    []string{updateUserId},                                               //账户标识*
-		"name":         []string{"数据流包"},                                                     //资源名称*
+		"accountId":    []string{updateUserId},                                                         //账户标识*
+		"name":         []string{"数据流包"},                                                           //资源名称*
 		"resourceType": []string{common.If(filter.PackType == 2, "高级字段包", "标准字段包").(string)}, //资源类型*
-		"number":       []string{fmt.Sprintf("%d", filter.PackNum+filter.GiveCycle)},         //数量*
-		"spec":         []string{"条"},                                                        //规格*
-		"endTime":      []string{time.Now().AddDate(2, 0, 0).Format(time.DateOnly)},          //截止时间
-		"remarks":      []string{gconv.String(filter)},                                       //备注
+		"number":       []string{fmt.Sprintf("%d", filter.PackNum+filter.GiveCycle)},                   //数量*
+		"spec":         []string{"条"},                                                                 //规格*
+		"endTime":      []string{time.Now().AddDate(2, 0, 0).Format(time.DateOnly)},                    //截止时间
+		"remarks":      []string{gconv.String(filter)},                                                 //备注
 		"entId":        []string{fmt.Sprint(entId)},
 		"entUserId":    []string{fmt.Sprint(entUserId)},
 	})

+ 2 - 2
internal/logic/product/otherProduct/saveUpdate.go

@@ -81,8 +81,8 @@ func (p jyOtherProduct) SaveUpdate(ctx context.Context, masterKey string) error
 			} else {
 				filter.FinalAccountCount += oldFilter.FinalAccountCount + filter.BuyAccountCount + filter.GiftAccountCount
 			}
-			orderMap["service_starttime"] = startTime.Format(time.DateTime)
-			orderMap["service_endtime"] = endTime.Format(time.DateTime)
+			orderMap["service_starttime"] = startTime.Format("2006-01-02 15:04:05")
+			orderMap["service_endtime"] = endTime.Format("2006-01-02 15:04:05")
 		}
 		orderMap["filter"] = gconv.String(filter)
 	case "3A信用认证", "ISO体系认证", "广告", "打赏", "数据文件", "权益码", "标书制作", "线下课程培训", "课程分销":

+ 2 - 2
internal/logic/product/subvip/saveUpdate.go

@@ -84,8 +84,8 @@ func (p jySubVipProduct) SaveUpdate(ctx context.Context, masterKey string) error
 			//账号升级
 			filter.FinalAccountCount += oldFilter.FinalAccountCount + filter.BuyAccountCount + filter.GiftAccountCount
 		}
-		newData["service_starttime"] = startTime.Format(time.DateTime)
-		newData["service_endtime"] = endTime.Format(time.DateTime)
+		newData["service_starttime"] = startTime.Format("2006-01-02 15:04:05")
+		newData["service_endtime"] = endTime.Format("2006-01-02 15:04:05")
 	}
 	newData["filter"] = gconv.String(filter)
 	if p.OrderDetail.Id > 0 {

+ 4 - 4
internal/logic/product/subvip/service.go

@@ -58,7 +58,7 @@ func (p jySubVipProduct) OpenService(ctx context.Context) error {
 					"areacount":       filter.FinalAccountCount,
 					"newcitys":        []int{},
 					"buyerclasscount": -1,
-				}, //购买内容 城市、省份、行业数量
+				},                                                    //购买内容 城市、省份、行业数量
 				"l_vip_starttime":      vipStartTime.Unix(),          //开始时间
 				"l_vip_endtime":        vipEndTime.Unix(),            //结束时间
 				"i_vip_status":         common.If(doType == 1, 2, 1), //1试用 2正式
@@ -163,9 +163,9 @@ func (p jySubVipProduct) OpenService(ctx context.Context) error {
 
 	//更新订单明细
 	_, err = g.DB().Update(ctx, consts.OrderDetailTableName, g.Map{
-		"service_starttime": vipStartTime.Format(time.DateTime),
-		"service_endtime":   vipEndTime.Format(time.DateTime),
-		"open_service_time": time.Now().Format(time.DateTime),
+		"service_starttime": vipStartTime.Format("2006-01-02 15:04:05"),
+		"service_endtime":   vipEndTime.Format("2006-01-02 15:04:05"),
+		"open_service_time": time.Now().Format("2006-01-02 15:04:05"),
 		"user_id":           updateUserId,
 		"is_service_open":   1,
 	}, "id=?", p.OrderDetail.Id)

+ 3 - 3
internal/logic/productManager/activity.go

@@ -16,7 +16,7 @@ func (p *sProductManager) loadActivity(ctx context.Context) error {
 		activityList        []*model.ActivityClass
 		activityCodeMapping = map[string]*model.ActivityClass{}
 	)
-	actList, err := g.DB().Query(ctx, "SELECT * FROM jy_product_activity WHERE state =1 and activity_ed_time > ?", time.Now().Format(time.DateTime))
+	actList, err := g.DB().Query(ctx, "SELECT * FROM jy_product_activity WHERE state =1 and activity_ed_time > ?", time.Now().Format("2006-01-02 15:04:05"))
 	if err != nil {
 		return errors.Wrap(err, "加载活动异常")
 	}
@@ -38,11 +38,11 @@ func (p *sProductManager) loadActivity(ctx context.Context) error {
 				st      = gconv.String(m["activity_st_time"])
 				ed      = gconv.String(m["activity_ed_time"])
 			)
-			s, err := time.ParseInLocation(time.DateTime, st, time.Local)
+			s, err := time.ParseInLocation("2006-01-02 15:04:05", st, time.Local)
 			if err != nil {
 				continue
 			}
-			e, err := time.ParseInLocation(time.DateTime, ed, time.Local)
+			e, err := time.ParseInLocation("2006-01-02 15:04:05", ed, time.Local)
 			if err != nil {
 				continue
 			}

+ 1 - 1
internal/logic/timedTask/automaticPayment.go

@@ -212,7 +212,7 @@ func PaymentPlanMatching(money, returnMoney int, paymentUser, companyName, remar
 }
 
 func CancelOnlinePay(ctx context.Context, orderCode string) {
-	if total, _ := g.DB().Ctx(ctx).Query(ctx, "SELECT count(*) from return_money_online WHERE  status=0 and order_code=? and expire_time >?", orderCode, time.Now().Format(time.DateTime)); !total.IsEmpty() {
+	if total, _ := g.DB().Ctx(ctx).Query(ctx, "SELECT count(*) from return_money_online WHERE  status=0 and order_code=? and expire_time >?", orderCode, time.Now().Format("2006-01-02 15:04:05")); !total.IsEmpty() {
 		r, err := rpc.DialHTTP("tcp", g.Cfg().MustGet(context.Background(), "jyPayRpc").String())
 		defer r.Close()
 		res := ""

+ 17 - 5
internal/logic/user/getService.go

@@ -8,6 +8,7 @@ import (
 	"fmt"
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/util/gconv"
+	"github.com/pkg/errors"
 	"jyOrderManager/internal/jyutil"
 	"jyOrderManager/internal/model"
 	"time"
@@ -80,6 +81,7 @@ WHERE a.status = 1 %s and a.user_id = '%s' and a.product_type like '%s' ORDER BY
 						})
 					}
 				}
+				var comboId int
 				switch param.ProductType {
 				case "VIP订阅":
 					vipExist = gconv.Int((*userData)["i_vip_status"]) == 2
@@ -92,7 +94,7 @@ WHERE a.status = 1 %s and a.user_id = '%s' and a.product_type like '%s' ORDER BY
 						if common.IntAll((*buySet)["upgrade"]) == 1 {
 							//newVip = true
 						}
-						endTime = time.Unix(common.Int64All((*userData)["l_vip_endtime"]), 0).Format(time.DateTime)
+						endTime = time.Unix(common.Int64All((*userData)["l_vip_endtime"]), 0).Format("2006-01-02 15:04:05")
 					}
 
 				case "大会员":
@@ -100,16 +102,17 @@ WHERE a.status = 1 %s and a.user_id = '%s' and a.product_type like '%s' ORDER BY
 					bigEnd := common.Int64All((*userData)["i_member_endtime"])
 					subStatus := common.IntAll((*userData)["i_member_sub_status"])
 					memberStatus := common.IntAll((*userData)["i_member_status"])
+					comboId = common.If(memberStatus == 5, 0, memberStatus).(int)
 					mainId := common.ObjToString((*userData)["s_member_mainid"])
 					if memberJyMap, ok1 := ((*userData)["o_member_jy"]).(map[string]interface{}); ok1 {
 						areaCount = common.IntAll(memberJyMap["i_areacount"])
 					}
 					if bigStart >= time.Now().Unix() {
-						endTime = time.Unix(bigEnd, 0).Format(time.DateTime)
+						endTime = time.Unix(bigEnd, 0).Format("2006-01-02 15:04:05")
 						vipExist = true
 					} else if (time.Now().Unix() < bigEnd && memberStatus > 0) || bigStart >= time.Now().Unix() {
 						vipExist = true
-						endTime = time.Unix(bigEnd, 0).Format(time.DateTime)
+						endTime = time.Unix(bigEnd, 0).Format("2006-01-02 15:04:05")
 					}
 					if (subStatus == 0 && memberStatus < 0 && mainId != "") || (subStatus == 1 && memberStatus > 0 && mainId != "") {
 						vipExist = true
@@ -152,12 +155,16 @@ WHERE a.status = 1 %s and a.user_id = '%s' and a.product_type like '%s' ORDER BY
 					"empowerCount":     paySubNum,         //服务授权数
 					"provinceCount":    areaCount,         //订阅省份
 					"buySubject":       1,                 //个体
+					"comboId":          comboId,           //套餐id
 					"serviceList":      serviceList,       //大会员服务id
 					"linkedId":         linkedId,          //关联id
 					"linkedOrder":      orderArr,          //关联订单
 				})
 			}
 		} else { //企业版本会员状态查询
+			if param.EntName == "" {
+				return nil, errors.New("企业名称获取异常")
+			}
 			//获取企业信息
 			vipRes, _ := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT a.id FROM entniche_info a
 inner JOIN entniche_user b on a.id = b.ent_id
@@ -166,19 +173,23 @@ WHERE b.phone = '%s' and a.name = '%s'`, param.Phone, param.EntName))
 				entID := gconv.String(vipRes.Map()["id"])
 				var whereEntTime string
 				if param.ServiceType != 1 && param.ServiceType != 4 {
-					whereEntTime = fmt.Sprintf(` and a.end_time>'%s' `, time.Now().Format(time.DateTime))
+					whereEntTime = fmt.Sprintf(` and a.end_time>'%s' `, time.Now().Format("2006-01-02 15:04:05"))
 				}
 				//获取企业下的服务
 				entService, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT * FROM entniche_wait_empower a 
 WHERE a.ent_id = '%s'  %s and a.product_type like '%s' and  ORDER BY a.create_time desc`, entID, whereEntTime, common.If(param.ProductType == "VIP订阅", "%VIP订阅%", `%大会员%`)))
 				if !entService.IsEmpty() {
 					for _, m := range entService.List() {
-						var serviceList []int
+						var (
+							serviceList []int
+							comboId     int
+						)
 						if param.ProductType == "大会员" {
 							//大会员获取下服务最新id
 							serviceId, _ := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT  b.filter FROM entniche_order a 
 	INNER JOIN  jy_order_detail b on a.order_detail_id = b.id WHERE a.wait_empower_id = %d ORDER BY a.create_time desc LIMIT 1`, gconv.Int(m["id"])))
 							if !serviceId.IsEmpty() {
+								comboId = gconv.Int(gconv.Map(serviceId.Map()["filter"])["comboId"])
 								for _, id := range gconv.Ints(gconv.Map(serviceId.Map()["filter"])["serviceIds"]) {
 									if id == 12 {
 										serviceList = append(serviceList, 23)
@@ -222,6 +233,7 @@ WHERE a.ent_id = '%s'  %s and a.product_type like '%s' and  ORDER BY a.create_ti
 							"provinceCount":    gconv.String(m["province_count"]), //订阅省份
 							"buySubject":       2,                                 //个体
 							"linkedId":         linkedId,                          //关联id
+							"comboId":          comboId,                           //套餐id
 							"serviceList":      serviceList,                       //大会员服务id
 							"linkedOrder":      orderArr,                          //关联订单
 						})

+ 8 - 7
internal/model/user.go

@@ -1,11 +1,12 @@
 package model
 
 type User struct {
-	PositionId int64 //职位id
-	EntUserId  int64 //企业用户id
-	EntId      int64 //企业id
-	EntDeptId  int64 //部门id
-	EntRole    int64
-	AccountId  int64
-	MgoUserId  string
+	PositionId  int64 //职位id
+	EntUserId   int64 //企业用户id
+	EntId       int64 //企业id
+	EntDeptId   int64 //部门id
+	EntRole     int64
+	AccountId   int64
+	MgoUserId   string
+	EntUserName string
 }