浏览代码

海威第三方

master
huangjiajun 4 天前
父节点
当前提交
9339edac8f
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. +9
    -6
      thirdParty/haiwei/api.go

+ 9
- 6
thirdParty/haiwei/api.go 查看文件

@@ -90,13 +90,13 @@ func HwSend(url string, param map[string]string, secret string) string {
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()
startTime := endTime - 86400
param := map[string]string{
"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"),
"time_type": "1",
"time_type": timeType,
"page_number": p,
"page_size": "50",
}
@@ -172,26 +172,29 @@ func HwSendOrder(eg *xorm.Engine, hwShareCode, hwSecret, method string, p string
json.Unmarshal([]byte(order), &list)
count = len(list)
for _, v := range list {
AddOrder(eg, method, v)
AddOrder(eg, method, v, prd)
}
}
if taskList != "" && taskList != "[]" {
var list = make([]map[string]interface{}, 0)
json.Unmarshal([]byte(taskList), &list)
for _, v := range list {
AddOrder(eg, method, v)
AddOrder(eg, method, v, prd)
}
}
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": "订单成功"}
userId := order["extra"]
if strings.Contains(utils.AnyToString(userId), "ddstar") == false {
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
}



正在加载...
取消
保存