|
@@ -130,14 +130,14 @@ class UpdateAccountInfoVersion3(object):
|
|
account_list = self.get_publishing_accounts()
|
|
account_list = self.get_publishing_accounts()
|
|
rate_dict = self.get_account_position_read_rate(dt)
|
|
rate_dict = self.get_account_position_read_rate(dt)
|
|
for account in tqdm(account_list, desc=dt):
|
|
for account in tqdm(account_list, desc=dt):
|
|
- business_type = self.const.TOULIU if account[
|
|
|
|
- 'gh_id'] in self.const.TOULIU_ACCOUNTS else self.const.ARTICLES_DAILY
|
|
|
|
- fans = fans_dict.get(account['gh_id'], {}).get(dt, 0)
|
|
|
|
|
|
+ gh_id = account["gh_id"]
|
|
|
|
+ business_type = self.const.TOULIU if gh_id in self.const.TOULIU_ACCOUNTS else self.const.ARTICLES_DAILY
|
|
|
|
+ fans = fans_dict.get(gh_id, {}).get(dt, 0)
|
|
if not fans:
|
|
if not fans:
|
|
- fans = int(unauthorized_account.get(account['gh_id'], 0))
|
|
|
|
|
|
+ fans = int(unauthorized_account.get(gh_id, 0))
|
|
if fans:
|
|
if fans:
|
|
for index in range(1, 9):
|
|
for index in range(1, 9):
|
|
- gh_id_position = "{}_{}".format(account['gh_id'], index)
|
|
|
|
|
|
+ gh_id_position = "{}_{}".format(gh_id, index)
|
|
if rate_dict.get(gh_id_position):
|
|
if rate_dict.get(gh_id_position):
|
|
rate = rate_dict[gh_id_position]
|
|
rate = rate_dict[gh_id_position]
|
|
read_avg = fans * rate
|
|
read_avg = fans * rate
|
|
@@ -152,7 +152,7 @@ class UpdateAccountInfoVersion3(object):
|
|
self.pq.update(
|
|
self.pq.update(
|
|
sql=insert_sql,
|
|
sql=insert_sql,
|
|
params=(
|
|
params=(
|
|
- account['gh_id'],
|
|
|
|
|
|
+ gh_id,
|
|
index,
|
|
index,
|
|
dt,
|
|
dt,
|
|
account['account_name'],
|
|
account['account_name'],
|