소스 검색

fix:合同金额修改

duxin 1 개월 전
부모
커밋
a923d64979
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      internal/logic/order/redPunch.go
  2. 1 1
      internal/logic/order/selfInvoice.go

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

@@ -21,7 +21,7 @@ import (
 
 // OperateOrderRedPunch 红冲
 func OperateOrderRedPunch(ctx context.Context, params model.OrderRedPunchParams) error {
-	orderData, err := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT user_phone,buy_subject,company_name,signing_subject,procedures_money,order_money,commission+(select IFNULL(sum(commission),0) as return_money from moneyCorrection where orderCode= '%s') as commission,(IFNULL(CASE WHEN is_backstage_order = 1 THEN pay_money ELSE order_money END, 0)) as pay_money+(select IFNULL(sum(payMoney),0) as return_money from moneyCorrection where orderCode='%s') as pay_money FROM dataexport_order  WHERE order_code = '%s'`, params.OrderCode, params.OrderCode, params.OrderCode))
+	orderData, err := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT user_phone,buy_subject,company_name,signing_subject,procedures_money,order_money,commission+(select IFNULL(sum(commission),0) as return_money from moneyCorrection where orderCode= '%s') as commission,(IFNULL(CASE WHEN is_backstage_order = 1 THEN pay_money ELSE order_money END, 0)) +(select IFNULL(sum(payMoney),0) as return_money from moneyCorrection where orderCode='%s') as pay_money FROM dataexport_order  WHERE order_code = '%s'`, params.OrderCode, params.OrderCode, params.OrderCode))
 	if err != nil || orderData.IsEmpty() {
 		return errors.New("未找到订单")
 	}

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

@@ -16,7 +16,7 @@ func SelfInvoice(ctx context.Context, param model.OrderDetailParams) (map[string
 		isFullBilling, isApplyBilling bool
 	)
 	//订单信息查询
-	orderData, _ := g.DB().GetOne(ctx, fmt.Sprintf("select   (IFNULL(CASE WHEN a.is_backstage_order = 1 THEN a.pay_money ELSE a.order_money END, 0)) as pay_money+(select IFNULL(sum(payMoney),0) as return_money from moneyCorrection where orderCode='%s' ) as pay_money,applybill_status,signing_subject from  dataexport_order  where  order_code ='%s'", param.OrderCode, param.OrderCode))
+	orderData, _ := g.DB().GetOne(ctx, fmt.Sprintf("select   (IFNULL(CASE WHEN is_backstage_order = 1 THEN pay_money ELSE order_money END, 0)) +(select IFNULL(sum(payMoney),0) as return_money from moneyCorrection where orderCode='%s' ) as pay_money,applybill_status,signing_subject from  dataexport_order  where  order_code ='%s'", param.OrderCode, param.OrderCode))
 	if orderData.IsEmpty() {
 		return nil, errors.New("订单编号不存在")
 	}