|
@@ -56,7 +56,11 @@ class CalcPostWeight extends Command
|
|
|
(3 * $postInfo->comment_count) -
|
|
|
(10 * $postInfo->dislike_count));
|
|
|
$fresh = (Carbon::parse($postInfo['created_at'])->timestamp) - (Carbon::parse("2019-05-01 00:00:00")->timestamp);
|
|
|
- $score = log10($temp) + $fresh / 86400;
|
|
|
+ if($temp){
|
|
|
+ $score = log10($temp) + $fresh / 86400;
|
|
|
+ }else{
|
|
|
+ $score = $fresh / 86400;
|
|
|
+ }
|
|
|
$postInfo->weight = $score;
|
|
|
$postInfo->save();
|
|
|
Redis::srem($key,$postId);
|