|
@ -99,10 +99,7 @@ def choose_new_next(min_like_num=10): |
|
|
last_paragraph_id = story.tail |
|
|
last_paragraph_id = story.tail |
|
|
next_one = Paragraph.query.filter_by(parent_id=last_paragraph_id, is_hidden=False)\ |
|
|
next_one = Paragraph.query.filter_by(parent_id=last_paragraph_id, is_hidden=False)\ |
|
|
.order_by(Paragraph.like_num.desc()).first() |
|
|
.order_by(Paragraph.like_num.desc()).first() |
|
|
print(next_one) |
|
|
|
|
|
if next_one and next_one.like_num >= min_like_num: |
|
|
if next_one and next_one.like_num >= min_like_num: |
|
|
print(next_one, next_one.like_num) |
|
|
|
|
|
|
|
|
|
|
|
story.text += next_one.text |
|
|
story.text += next_one.text |
|
|
story.total_like_num += next_one.like_num |
|
|
story.total_like_num += next_one.like_num |
|
|
story.tail = next_one.id |
|
|
story.tail = next_one.id |
|
|