Skip to content

Commit

Permalink
- 类型为default的词,设置热度最小值为100;
Browse files Browse the repository at this point in the history
  • Loading branch information
lonblues committed Jun 15, 2015
1 parent ace18e1 commit 9e36886
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion host/Prohot.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ function load_file($url) {
$words = $db->Prowords->find();
foreach ($words as $key1 => $word) {
if (floor((time() - $word['word_checkTime'])/86400) >0) {
$word['word_hotness'] = $word['word_hotness'] * exp(-0.05) * floor((time() - $word['word_checkTime'])/86400) ;
$newHotness = $word['word_hotness'] * exp(-0.05) * floor((time() - $word['word_checkTime'])/86400);
if ($word['word_type'] == 'default') {
if ($newHotness < 100) {
$word['word_hotness'] = 100;
}else{
$word['word_hotness'] = $newHotness;
}
}else{
$word['word_hotness'] = $newHotness;
}

$word['word_checkTime'] = time();
$db->Prowords->save($word);
}
Expand Down

0 comments on commit 9e36886

Please sign in to comment.