This commit is contained in:
parent
a52ed56a66
commit
c3856433bc
|
@ -558,6 +558,17 @@ mid_zid_list = [
|
||||||
[999164, 91]
|
[999164, 91]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
csv_ = Csv("myts_refund.csv", ["订单id", "商品", "订单金额", "结果", "res"])
|
||||||
|
|
||||||
|
|
||||||
|
def refund_order(order_id):
|
||||||
|
url = "https://api.tiefen.fun/op/vas/refund_order"
|
||||||
|
param = {
|
||||||
|
"order_id": order_id,
|
||||||
|
"operator": "myts_lwl_fix"
|
||||||
|
}
|
||||||
|
return call_service(url, param)
|
||||||
|
|
||||||
|
|
||||||
class S:
|
class S:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -601,16 +612,25 @@ class S:
|
||||||
print(status_cnt_map)
|
print(status_cnt_map)
|
||||||
|
|
||||||
refund_amount = 0
|
refund_amount = 0
|
||||||
|
idx = 0
|
||||||
for d in docs:
|
for d in docs:
|
||||||
|
idx += 1
|
||||||
status = safe_get_int(d, "order_status")
|
status = safe_get_int(d, "order_status")
|
||||||
if status != 3:
|
if status != 3:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
order_id = safe_get_int(d, "id")
|
order_id = safe_get_str(d, "id")
|
||||||
|
product_id = safe_get_str(d, "product_id")
|
||||||
pay_amount = safe_get_int(d, "pay_amount")
|
pay_amount = safe_get_int(d, "pay_amount")
|
||||||
print(order_id, pay_amount)
|
print(order_id, pay_amount)
|
||||||
refund_amount += pay_amount
|
refund_amount += pay_amount
|
||||||
|
|
||||||
|
res = refund_order(order_id)
|
||||||
|
ret = safe_get_int(res, "ret")
|
||||||
|
docu = [order_id, product_id, pay_amount, ret, res]
|
||||||
|
print(idx, docu)
|
||||||
|
csv_.append(docu)
|
||||||
|
|
||||||
print(refund_amount)
|
print(refund_amount)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue