Files
2025-10-20 12:32:18 +08:00

4.6 KiB

In [26]:
import requests
from datetime import datetime
ip = 'https://band.hxzhxy.cn'
param = {
    "username": "xiatianle",
    "password": "123456",
    "client_id": "client",
    "grant_type": "password",
    "client_secret": "123456",
}
data = requests.get(url=f"{ip}/oauth/token", params=param).json()
token = data["access_token"]
header = {
    "content-type": "application/json",
    "authorization": f"Bearer {token}",
}
In [27]:
requests.get(f'{ip}/uc/account/getInfo',params={"access_token": token}).json()
Out [27]:
{'success': True,
 'msg': '操作成功',
 'code': 0,
 'data': {'imgUrl': None,
  'gradeId': None,
  'classId': None,
  'teaName': '夏天乐',
  'nickName': None,
  'teamId': 19,
  'teaId': None,
  'userName': 'xiatianle'}}
In [7]:
startDate = int(datetime.strptime("2023-06-01", "%Y-%m-%d").timestamp()*1000)
endDate = int(datetime.strptime("2023-07-15", "%Y-%m-%d").timestamp()*1000)
res = requests.get(f"{ip}/pay/stu/total",params={
    "access_token": token,
    "teamId": "19",
    "startDate":startDate,
    "endDate":endDate
}).json()
print(res)
{'success': True, 'msg': '操作成功', 'code': 0, 'data': [{'refundFee': 0.0, 'refundNum': 0, 'payFee': 23115000.0, 'totalNum': 609, 'totalFee': 23115000.0, 'payNum': 609, 'payName': '晚自习延时'}, {'refundFee': 0.0, 'refundNum': 0, 'payNum': 3462, 'payFee': 37168400.0, 'totalFee': 37168400.0, 'payName': '餐费充值', 'totalNum': 3462}, {'refundFee': 0.0, 'refundNum': 0, 'totalNum': 953, 'payNum': 953, 'totalFee': 25735500.0, 'payName': '延时服务费', 'payFee': 25735500.0}, {'refundFee': 0.0, 'refundNum': 0, 'payNum': 143, 'payFee': 3170000.0, 'totalNum': 143, 'totalFee': 3170000.0, 'payName': '周末托管报名'}]}
In [8]:
startDate
Out [8]:
1685548800000
In [12]:
function formatAmount(amount) {
    return amount.toLocaleString('en-US', { style: 'currency', currency: 'CNY' });
  }
  
  let amount = 72538000;
  console.log(formatAmount(amount)); 
  Cell In[12], line 1
    function formatAmount(amount) {
             ^
SyntaxError: invalid syntax
In [11]:
refundFee tuikuan
totalFee shenyu
payFee
payNum shoufeibishu
refundNum tuikuanbishu
Out [11]:
1720972800000