浏览代码

fix:合同金额修改

duxin 1 月之前
父节点
当前提交
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("订单编号不存在")
 	}