|
@@ -1183,7 +1183,6 @@ class CronComparedDataView(View):
|
|
|
start_date = today - datetime.timedelta(days=2)
|
|
|
start_date = datetime.datetime(start_date.year, start_date.month, start_date.day)
|
|
|
end_date = start_date + datetime.timedelta(days=1)
|
|
|
- end_date_stamp = int(end_date.timestamp())
|
|
|
try:
|
|
|
data = (
|
|
|
('start_date', '{}-{}-{}T08:00:00-0800'.format(start_date.year, start_date.month, start_date.day)),
|
|
@@ -1194,7 +1193,7 @@ class CronComparedDataView(View):
|
|
|
)
|
|
|
order_list = PayPalService(PAYPAL_CRD['client_id'], PAYPAL_CRD['client_secret']).get_transactions(data)
|
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_order,
|
|
|
- args=(order_list['transaction_details'], end_date_stamp))
|
|
|
+ args=(order_list['transaction_details']))
|
|
|
thread.start()
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
@@ -1203,7 +1202,8 @@ class CronComparedDataView(View):
|
|
|
return response.json(500)
|
|
|
|
|
|
@staticmethod
|
|
|
- def thread_compared_order(order_list, timestamp):
|
|
|
+ def thread_compared_order(order_list):
|
|
|
+ now_time = int(time.time())
|
|
|
for item in order_list:
|
|
|
trade_no = item['transaction_info']['transaction_id']
|
|
|
order_qs = Order_Model.objects.filter(trade_no=trade_no, payType=1)
|
|
@@ -1220,7 +1220,7 @@ class CronComparedDataView(View):
|
|
|
'username': item['payer_info']['email_address'],
|
|
|
'price': item['transaction_info']['transaction_amount']['value'],
|
|
|
'pay_type': 1,
|
|
|
- 'add_time': timestamp,
|
|
|
+ 'upd_time': now_time,
|
|
|
'status': 0
|
|
|
}
|
|
|
if order_id and agreement_id:
|