|
@@ -228,7 +228,7 @@ class predeposit_helper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if($fUpdate)
|
|
|
+ if($fUpdate || $this->need_update())
|
|
|
{
|
|
|
$mod_bonus = Model('user_bonus');
|
|
|
$this->mRates = new RateMoney(array());
|
|
@@ -249,6 +249,19 @@ class predeposit_helper
|
|
|
}
|
|
|
$this->write_rates($this->mBonusState,$bonus_rate);
|
|
|
$this->mRates->clean();
|
|
|
+ $_SESSION['bonus_update_time'] = time();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private function need_update()
|
|
|
+ {
|
|
|
+ if(!isset($_SESSION['bonus_update_time'])) return true;
|
|
|
+
|
|
|
+ $time = intval($_SESSION['bonus_update_time']);
|
|
|
+ if(time() - $time > 86400) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
|