|
@@ -40,7 +40,7 @@ func GetUserService(ctx context.Context, param model.UserServiceParams) (interfa
|
|
|
if param.ProductType != "大会员" && param.ProductType != "VIP订阅" {
|
|
|
serviceArrMap = SpecialService(ctx, userId, param.ProductType)
|
|
|
} else {
|
|
|
- sqlStr := fmt.Sprintf(`SELECT b.* FROM jy_order_detail
|
|
|
+ sqlStr := fmt.Sprintf(`SELECT * FROM jy_order_detail
|
|
|
WHERE status = 1 and is_service_open = 0 and user_id = '%s' and product_type like '%s' AND service_endtime < '%s'`, userId, common.If(param.ProductType == "VIP订阅", "%VIP订阅%", "%大会员%"), time.Now().Format(date.Date_Full_Layout))
|
|
|
if param.OrderCode != "" {
|
|
|
sqlStr += fmt.Sprintf(" AND order_code != '%s'", param.OrderCode)
|
|
@@ -69,9 +69,9 @@ WHERE status = 1 and is_service_open = 0 and user_id = '%s' and product_type lik
|
|
|
//续费升级关联
|
|
|
whereEntTime = "and b.order_status = 1"
|
|
|
}
|
|
|
- orderData, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT b.id,b.service_type,b.order_code,a.create_time FROM jy_order_detail a
|
|
|
+ orderData, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT a.id,a.service_type,a.order_code,b.create_time FROM jy_order_detail a
|
|
|
INNER JOIN dataexport_order b on a.order_code = b.order_code
|
|
|
-WHERE a.status = 1 %s and a.user_id = '%s' and a.product_type like '%s' ORDER BY a.create_time desc `, whereEntTime, userId, common.If(param.ProductType == "VIP订阅", "%VIP订阅%", "%大会员%")))
|
|
|
+WHERE a.status = 1 %s and a.user_id = '%s' and a.product_type like '%s' ORDER BY b.create_time desc `, whereEntTime, userId, common.If(param.ProductType == "VIP订阅", "%VIP订阅%", "%大会员%")))
|
|
|
if !orderData.IsEmpty() {
|
|
|
for _, m2 := range orderData.List() {
|
|
|
if linkedId == 0 {
|