duxin 1 месяц назад
Родитель
Сommit
c01750dda7
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      internal/logic/order/selfInvoice.go

+ 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   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 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))
 	if orderData.IsEmpty() {
 		return nil, errors.New("订单编号不存在")
 	}