Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
graces_es6
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
graces_es6
Commits
f1da1220
Commit
f1da1220
authored
Oct 30, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
99ef99ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
diary.py
talos/models/diary/diary.py
+3
-5
No files found.
talos/models/diary/diary.py
View file @
f1da1220
...
...
@@ -184,7 +184,7 @@ class Diary(models.Model):
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
''
def
get_keynote_sentence
(
user_id
=
None
,
id
=
None
):
def
get_keynote_sentence
(
self
,
user_id
=
None
,
id
=
None
):
try
:
result
=
Problems
.
objects
.
filter
(
user_id
=
user_id
,
topic_type__in
=
[
"0"
,
"1"
,
"2"
],
diary_id
=
id
,
is_online
=
True
)
.
order_by
(
'-last_modified'
)
.
values_list
(
...
...
@@ -216,7 +216,6 @@ class Diary(models.Model):
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
''
def
get_hot_score
(
self
,
reply_num
):
try
:
now
=
datetime
.
datetime
.
now
()
...
...
@@ -260,7 +259,8 @@ class Diary(models.Model):
def
get_good_click
(
self
):
try
:
results
=
list
(
PageGoodClick
.
objects
.
using
(
settings
.
DORIS_DB_NAME
)
.
filter
(
business_id
=
self
.
id
,
page_name
=
"diary_detail"
)
PageGoodClick
.
objects
.
using
(
settings
.
DORIS_DB_NAME
)
.
filter
(
business_id
=
self
.
id
,
page_name
=
"diary_detail"
)
.
order_by
(
'-create_date'
)
.
values_list
(
"avg_new_gc"
,
flat
=
True
))
good_click_score
=
results
and
results
[
0
]
or
0
return
good_click_score
...
...
@@ -1259,7 +1259,6 @@ class PageGoodClick(models.Model):
db_table
=
'al_community_detail_page_goodclick_v2'
app_label
=
'doris'
page_name
=
models
.
CharField
(
max_length
=
50
)
business_id
=
models
.
CharField
(
max_length
=
50
)
detail_uv
=
models
.
IntegerField
()
...
...
@@ -1270,7 +1269,6 @@ class PageGoodClick(models.Model):
create_date
=
models
.
CharField
(
max_length
=
50
)
class
CpcPromote
(
models
.
Model
):
class
Meta
:
db_table
=
'cpc_community_communitypromote'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment