|
@@ -54,17 +54,17 @@ class CalcPostWeight extends Command
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
Log::debug('帖子:' . json_encode($postInfo));
|
|
Log::debug('帖子:' . json_encode($postInfo));
|
|
- $temp = ($postInfo['pv'] +
|
|
|
|
|
|
+ $temp = (0.2 * $postInfo['pv'] +
|
|
(5 * $postInfo->share_count) +
|
|
(5 * $postInfo->share_count) +
|
|
- (2 * $postInfo->praise_count) +
|
|
|
|
|
|
+ (3 * $postInfo->praise_count) +
|
|
(10 * $postInfo->collect_count) +
|
|
(10 * $postInfo->collect_count) +
|
|
- (3 * $postInfo->comment_count) -
|
|
|
|
- (10 * $postInfo->dislike_count));
|
|
|
|
|
|
+ (5 * $postInfo->comment_count) -
|
|
|
|
+ (23 * $postInfo->dislike_count));
|
|
$fresh = (Carbon::parse($postInfo['created_at'])->timestamp) - (Carbon::parse("2019-05-01 00:00:00")->timestamp);
|
|
$fresh = (Carbon::parse($postInfo['created_at'])->timestamp) - (Carbon::parse("2019-05-01 00:00:00")->timestamp);
|
|
if($temp){
|
|
if($temp){
|
|
- $score = log10($temp) + $fresh / 86400;
|
|
|
|
|
|
+ $score = log10($temp) + $fresh / 43200;
|
|
}else{
|
|
}else{
|
|
- $score = $fresh / 86400;
|
|
|
|
|
|
+ $score = $fresh / 43200;
|
|
}
|
|
}
|
|
$post->weight = $score;
|
|
$post->weight = $score;
|
|
$post->save();
|
|
$post->save();
|