This commit is contained in:
lwl0608 2024-11-11 22:16:41 +08:00
parent a52ed56a66
commit c3856433bc
1 changed files with 21 additions and 1 deletions

View File

@ -558,6 +558,17 @@ mid_zid_list = [
[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:
def __init__(self):
@ -601,16 +612,25 @@ class S:
print(status_cnt_map)
refund_amount = 0
idx = 0
for d in docs:
idx += 1
status = safe_get_int(d, "order_status")
if status != 3:
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")
print(order_id, 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)