|
@@ -21,7 +21,7 @@ import (
|
|
|
|
|
|
// OperateOrderRedPunch 红冲
|
|
// OperateOrderRedPunch 红冲
|
|
func OperateOrderRedPunch(ctx context.Context, params model.OrderRedPunchParams) error {
|
|
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,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)) 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))
|
|
if err != nil || orderData.IsEmpty() {
|
|
if err != nil || orderData.IsEmpty() {
|
|
return errors.New("未找到订单")
|
|
return errors.New("未找到订单")
|
|
}
|
|
}
|