Browse Source

海威第三方

master
huangjiajun 4 days ago
parent
commit
9339edac8f
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      thirdParty/haiwei/api.go

+ 9
- 6
thirdParty/haiwei/api.go View File

@@ -90,13 +90,13 @@ func HwSend(url string, param map[string]string, secret string) string {
return url return url
} }


func HwSendOrder(eg *xorm.Engine, hwShareCode, hwSecret, method string, p string) int {
func HwSendOrder(eg *xorm.Engine, hwShareCode, hwSecret, method string, p, timeType string, prd bool) int {
endTime := time.Now().Unix() endTime := time.Now().Unix()
startTime := endTime - 86400 startTime := endTime - 86400
param := map[string]string{ param := map[string]string{
"start_time": time.Unix(startTime, 0).Format("2006-01-02 15:04:05"), "start_time": time.Unix(startTime, 0).Format("2006-01-02 15:04:05"),
"end_time": time.Unix(endTime, 0).Format("2006-01-02 15:04:05"), "end_time": time.Unix(endTime, 0).Format("2006-01-02 15:04:05"),
"time_type": "1",
"time_type": timeType,
"page_number": p, "page_number": p,
"page_size": "50", "page_size": "50",
} }
@@ -172,26 +172,29 @@ func HwSendOrder(eg *xorm.Engine, hwShareCode, hwSecret, method string, p string
json.Unmarshal([]byte(order), &list) json.Unmarshal([]byte(order), &list)
count = len(list) count = len(list)
for _, v := range list { for _, v := range list {
AddOrder(eg, method, v)
AddOrder(eg, method, v, prd)
} }
} }
if taskList != "" && taskList != "[]" { if taskList != "" && taskList != "[]" {
var list = make([]map[string]interface{}, 0) var list = make([]map[string]interface{}, 0)
json.Unmarshal([]byte(taskList), &list) json.Unmarshal([]byte(taskList), &list)
for _, v := range list { for _, v := range list {
AddOrder(eg, method, v)
AddOrder(eg, method, v, prd)
} }
} }
return count return count
} }
func AddOrder(eg *xorm.Engine, method string, order map[string]interface{}) {
func AddOrder(eg *xorm.Engine, method string, order map[string]interface{}, prd bool) {


statusArr := map[string]string{"FINISHED": "订单成功", "GENERATE_SUCCESS": "订单成功", "WAIT_GENERATE": "订单付款", "WAIT_PAY": "创建订单", "CLOSED": "订单失效", "CANCELED": "订单失效", "FAIL": "订单失效", "CLOSE": "订单失效", "RETURNED": "订单失效", "UNPAID": "创建订单", "PAYED": "订单付款", "DEALING": "订单付款", "SENDING": "订单付款", "ORDER_RECEIVED": "订单付款", "RECEIVED": "订单成功", "RECEIVED_ORDER": "订单付款", "WAITING_RECEIVED": "订单付款", "WAIT_OUT_MEAL": "订单付款", "MAKING": "订单付款", "ARRIVED": "订单成功", "COMPLETE": "订单成功", "REFUNDED": "订单退款", "OUT_MEAL": "订单成功"} statusArr := map[string]string{"FINISHED": "订单成功", "GENERATE_SUCCESS": "订单成功", "WAIT_GENERATE": "订单付款", "WAIT_PAY": "创建订单", "CLOSED": "订单失效", "CANCELED": "订单失效", "FAIL": "订单失效", "CLOSE": "订单失效", "RETURNED": "订单失效", "UNPAID": "创建订单", "PAYED": "订单付款", "DEALING": "订单付款", "SENDING": "订单付款", "ORDER_RECEIVED": "订单付款", "RECEIVED": "订单成功", "RECEIVED_ORDER": "订单付款", "WAITING_RECEIVED": "订单付款", "WAIT_OUT_MEAL": "订单付款", "MAKING": "订单付款", "ARRIVED": "订单成功", "COMPLETE": "订单成功", "REFUNDED": "订单退款", "OUT_MEAL": "订单成功"}
userId := order["extra"] userId := order["extra"]
if strings.Contains(utils.AnyToString(userId), "ddstar") == false { if strings.Contains(utils.AnyToString(userId), "ddstar") == false {
return return
} }
if strings.Contains(utils.AnyToString(userId), "dev") {
if strings.Contains(utils.AnyToString(userId), "dev") && prd {
return
}
if strings.Contains(utils.AnyToString(userId), "prd") && prd == false {
return return
} }




Loading…
Cancel
Save