|
@ -8,6 +8,7 @@ import ( |
|
|
"hudongzhuanjia/models" |
|
|
"hudongzhuanjia/models" |
|
|
"hudongzhuanjia/services/im" |
|
|
"hudongzhuanjia/services/im" |
|
|
"hudongzhuanjia/utils" |
|
|
"hudongzhuanjia/utils" |
|
|
|
|
|
"hudongzhuanjia/utils/define" |
|
|
"time" |
|
|
"time" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@ -167,10 +168,16 @@ func HandleGoodOrder() error { |
|
|
if v.Type != 1 || v.Status != 0 { |
|
|
if v.Type != 1 || v.Status != 0 { |
|
|
continue |
|
|
continue |
|
|
} |
|
|
} |
|
|
_, err := OrderQuery(v.OutTradeNo) |
|
|
|
|
|
if err == nil { |
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
res, err := OrderQuery(v.OutTradeNo) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
err = fmt.Errorf("订单查询出现错误: %v, out_trade_no: %v", err, v.OutTradeNo) |
|
|
|
|
|
return err |
|
|
} |
|
|
} |
|
|
|
|
|
if res["trade_state"] != define.CODE_TRADE_NOTPAY { |
|
|
|
|
|
err = fmt.Errorf("订单非未支付订单: %v, out_trade_no: %v", res["trade_state"], v.OutTradeNo) |
|
|
|
|
|
return err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
err = Close(v.OutTradeNo) |
|
|
err = Close(v.OutTradeNo) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return err |
|
|
return err |
|
|