|
@@ -224,15 +224,15 @@ class AccountOpenRateAvgTask(AccountDataTask):
|
|
|
"""
|
|
|
|
|
|
def set_avg_open_rate_for_each_account(
|
|
|
- self, gh_id: str, date_string: str, index: int, avg_read_rate: float
|
|
|
+ self, gh_id: str, date_string: str, avg_read_rate: float
|
|
|
) -> int:
|
|
|
update_sql = f"""
|
|
|
update account_avg_info_v3
|
|
|
set open_rate_avg = %s
|
|
|
- where gh_id = %s and position = %s and update_time = %s;
|
|
|
+ where gh_id = %s and update_time = %s;
|
|
|
"""
|
|
|
return self.piaoquan_crawler_db_client.save(
|
|
|
- update_sql, params=(avg_read_rate, gh_id, index, date_string)
|
|
|
+ update_sql, params=(avg_read_rate, gh_id, date_string)
|
|
|
)
|
|
|
|
|
|
def get_account_open_rate(self, gh_id: str, date_string: str) -> float:
|
|
@@ -264,10 +264,9 @@ class AccountOpenRateAvgTask(AccountDataTask):
|
|
|
avg_read_rate = self.get_account_open_rate(
|
|
|
gh_id=gh_id, date_string=date_string.replace("-", "")
|
|
|
)
|
|
|
- for index in const.ARTICLE_INDEX_LIST:
|
|
|
- self.set_avg_open_rate_for_each_account(
|
|
|
- gh_id, date_string, index, avg_read_rate
|
|
|
- )
|
|
|
+ self.set_avg_open_rate_for_each_account(
|
|
|
+ gh_id, date_string, avg_read_rate
|
|
|
+ )
|
|
|
except Exception as e:
|
|
|
log(
|
|
|
task="account_open_rate_producer",
|