aa
This commit is contained in:
@@ -771,7 +771,8 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
|
|||||||
offset = jxutils.FormalizePageOffset(offset)
|
offset = jxutils.FormalizePageOffset(offset)
|
||||||
|
|
||||||
sql := fmt.Sprintf(`
|
sql := fmt.Sprintf(`
|
||||||
SELECT SQL_CALC_FOUND_ROWS
|
SELECT SQL_CALC_FOUND_ROWS * FROM (
|
||||||
|
SELECT
|
||||||
DISTINCT t1.*,
|
DISTINCT t1.*,
|
||||||
CAST(IF(t1.earning_price <> 0, t1.earning_price, IF(t1.shop_price <> 0 && t1.shop_price < t1.sale_price, t1.shop_price, t1.sale_price) * IF(t1.order_pay_percentage > 0, t1.order_pay_percentage, %d) / 100) AS SIGNED) earning_price,
|
CAST(IF(t1.earning_price <> 0, t1.earning_price, IF(t1.shop_price <> 0 && t1.shop_price < t1.sale_price, t1.shop_price, t1.sale_price) * IF(t1.order_pay_percentage > 0, t1.order_pay_percentage, %d) / 100) AS SIGNED) earning_price,
|
||||||
t2.status waybill_status, t2.courier_name, t2.courier_mobile,
|
t2.status waybill_status, t2.courier_name, t2.courier_mobile,
|
||||||
@@ -930,18 +931,6 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
|
|||||||
// sqlParams = append(sqlParams, params["deliveryType"].(string))
|
// sqlParams = append(sqlParams, params["deliveryType"].(string))
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
if params["jxIncomeBegin"] != nil {
|
|
||||||
if utils.MustInterface2Int64(params["jxIncomeBegin"]) != 0 {
|
|
||||||
sqlWhere += " AND jx_income >= ?"
|
|
||||||
sqlParams = append(sqlParams, utils.MustInterface2Int64(params["jxIncomeBegin"]))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if params["jxIncomeEnd"] != nil {
|
|
||||||
if utils.MustInterface2Int64(params["jxIncomeEnd"]) != 0 {
|
|
||||||
sqlWhere += " AND jx_income <= ?"
|
|
||||||
sqlParams = append(sqlParams, utils.MustInterface2Int64(params["jxIncomeEnd"]))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if params["cities"] != nil {
|
if params["cities"] != nil {
|
||||||
var cities []int
|
var cities []int
|
||||||
if err = utils.UnmarshalUseNumber([]byte(params["cities"].(string)), &cities); err != nil {
|
if err = utils.UnmarshalUseNumber([]byte(params["cities"].(string)), &cities); err != nil {
|
||||||
@@ -998,9 +987,20 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sql += `
|
sql += `
|
||||||
LIMIT ? OFFSET ?`
|
LIMIT ? OFFSET ?) WHERE 1 = 1`
|
||||||
sqlParams = append(sqlParams, pageSize, offset)
|
sqlParams = append(sqlParams, pageSize, offset)
|
||||||
|
if params["jxIncomeBegin"] != nil {
|
||||||
|
if utils.MustInterface2Int64(params["jxIncomeBegin"]) != 0 {
|
||||||
|
sqlWhere += " AND jx_income >= ?"
|
||||||
|
sqlParams = append(sqlParams, utils.MustInterface2Int64(params["jxIncomeBegin"]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if params["jxIncomeEnd"] != nil {
|
||||||
|
if utils.MustInterface2Int64(params["jxIncomeEnd"]) != 0 {
|
||||||
|
sqlWhere += " AND jx_income <= ?"
|
||||||
|
sqlParams = append(sqlParams, utils.MustInterface2Int64(params["jxIncomeEnd"]))
|
||||||
|
}
|
||||||
|
}
|
||||||
txDB, _ := Begin(db)
|
txDB, _ := Begin(db)
|
||||||
defer Commit(db, txDB)
|
defer Commit(db, txDB)
|
||||||
fmt.Println(sql)
|
fmt.Println(sql)
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ func OnCallbackMsg(msg *mtwmapi.CallbackMsg) (response *mtwmapi.CallbackResponse
|
|||||||
response = CurPurchaseHandler.onStoreStatusChanged(msg)
|
response = CurPurchaseHandler.onStoreStatusChanged(msg)
|
||||||
} else if msg.Cmd == mtwmapi.MsgTypePrivateNumberDowngrade {
|
} else if msg.Cmd == mtwmapi.MsgTypePrivateNumberDowngrade {
|
||||||
response = CurPurchaseHandler.onNumberDowngrade(msg)
|
response = CurPurchaseHandler.onNumberDowngrade(msg)
|
||||||
|
} else if msg.Cmd == mtwmapi.MsgTypeStoreBind {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if orderID := GetOrderIDFromMsg(msg); orderID != "" {
|
if orderID := GetOrderIDFromMsg(msg); orderID != "" {
|
||||||
jxutils.CallMsgHandler(func() {
|
jxutils.CallMsgHandler(func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user