查询订单是否是第一次下单
This commit is contained in:
@@ -1371,13 +1371,17 @@ func RefreshJdShopOrdersEarningPrice(ctx *jxcontext.Context, orderStartTime, ord
|
|||||||
func GetOrderUserBuyFirst(ctx *jxcontext.Context, vendorOrderID string) (orderPay *model.OrderPay, err error) {
|
func GetOrderUserBuyFirst(ctx *jxcontext.Context, vendorOrderID string) (orderPay *model.OrderPay, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT b.*
|
SELECT b.*
|
||||||
FROM goods_order a, order_pay b
|
FROM goods_order a, order_pay b
|
||||||
WHERE a.vendor_order_id = b.vendor_order_id
|
WHERE a.vendor_order_id = b.vendor_order_id
|
||||||
AND a.vendor_id = b.vendor_id
|
AND a.vendor_id = b.vendor_id
|
||||||
AND b.pay_finished_at <> NULL
|
AND b.pay_finished_at <> 0
|
||||||
AND a.vendor_order_id = ?
|
AND a.vendor_id = ?
|
||||||
|
AND a.user_id = (
|
||||||
|
SELECT user_id
|
||||||
|
FROM goods_order WHERE vendor_order_id = ?)
|
||||||
|
AND a.vendor_order_id <> ?
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{vendorOrderID}
|
sqlParams := []interface{}{model.VendorIDJX, vendorOrderID, vendorOrderID}
|
||||||
err = dao.GetRow(dao.GetDB(), &orderPay, sql, sqlParams)
|
err = dao.GetRow(dao.GetDB(), &orderPay, sql, sqlParams)
|
||||||
return orderPay, err
|
return orderPay, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user