소스 검색

fix:修改

duxin 2 달 전
부모
커밋
d2aeb6e693
2개의 변경된 파일17개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 0
      internal/controller/invoiceUpload.go
  2. 15 4
      internal/logic/user/getService.go

+ 2 - 0
internal/controller/invoiceUpload.go

@@ -11,6 +11,7 @@ import (
 	"github.com/pkg/errors"
 	"jyOrderManager/internal/jyutil"
 	"jyOrderManager/internal/model"
+	"log"
 	"time"
 )
 
@@ -49,6 +50,7 @@ func InvoiceUpload(r *ghttp.Request) {
 		data["operator"] = jyutil.GetUserMsgFromCtx(r.Context()).EntUserId
 		data["source"] = 3
 		data["invoice_status"] = 1
+		log.Println("发票上传参数", data, param.Id)
 		if param.Id == 0 {
 			onlyIdentifying := fmt.Sprintf("%s%s%s", "aa", time.Now().Format("150405"), common.GetRandom(4))
 			data["only_Identifying"] = onlyIdentifying

+ 15 - 4
internal/logic/user/getService.go

@@ -95,9 +95,14 @@ WHERE %s and jod.status =1 order by dor.create_time desc`, whereSql))
 						serviceList                                                         []int
 					)
 					startTime := common.Int64All((*userData)["i_member_starttime"])
+					if startTime > 0 {
+						sTime = time.Unix(startTime, 0).Format("2006-01-02 15:04:05")
+					}
+
 					bigEnd := common.Int64All((*userData)["i_member_endtime"])
-					sTime = time.Unix(startTime, 0).Format("2006-01-02 15:04:05")
-					eTime = time.Unix(bigEnd, 0).Format("2006-01-02 15:04:05")
+					if bigEnd > 0 {
+						eTime = time.Unix(bigEnd, 0).Format("2006-01-02 15:04:05")
+					}
 
 					orderData, _ := g.DB().Query(ctx, `SELECT   a.product_code,a.id,a.service_type,a.order_code,b.create_time,a.service_starttime,a.service_endtime,a.filter   FROM jy_order_detail  a
 INNER JOIN dataexport_order b on a.order_code = b.order_code
@@ -214,8 +219,14 @@ WHERE a.status = 1 and b.user_phone = ? and b.buy_subject = 1 and a.product_type
 						}
 					}
 					vipExist = gconv.Int((*userData)["i_vip_status"]) > 0
-					endTime = time.Unix(common.Int64All((*userData)["l_vip_endtime"]), 0).Format("2006-01-02 15:04:05")
-					startTime = time.Unix(common.Int64All((*userData)["l_vip_starttime"]), 0).Format("2006-01-02 15:04:05")
+					l_vip_endtime := common.Int64All((*userData)["l_vip_endtime"])
+					if l_vip_endtime > 0 {
+						endTime = time.Unix(l_vip_endtime, 0).Format("2006-01-02 15:04:05")
+					}
+					l_vip_starttime := common.Int64All((*userData)["l_vip_starttime"])
+					if l_vip_endtime > 0 {
+						startTime = time.Unix(l_vip_starttime, 0).Format("2006-01-02 15:04:05")
+					}
 					if vipExist {
 						vipInfo := common.ObjToMap((*userData)["o_vipjy"])
 						buySet := common.ObjToMap((*vipInfo)["o_buyset"])