|
@@ -55,21 +55,24 @@ class notify_helper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- static public function bonus_expired()
|
|
|
+ static public function bonus_expired($maxtm)
|
|
|
{
|
|
|
$mod_bonus = Model("user_bonus");
|
|
|
- $items = $mod_bonus->getExpired();
|
|
|
+ $items = $mod_bonus->getExpired($maxtm);
|
|
|
|
|
|
- $ids = array();
|
|
|
+ if(empty($items)) return false;
|
|
|
+
|
|
|
+ $ids = [];
|
|
|
$member_amount = [];
|
|
|
- foreach ($items as $key => $val) {
|
|
|
+ foreach ($items as $key => $val)
|
|
|
+ {
|
|
|
$bonus = bonus\user_bonus::create_by_param($val);
|
|
|
$user_id = $bonus->user_id();
|
|
|
- $amount = $bonus->remain_amount();
|
|
|
+ $amount = $bonus->remain_amount();
|
|
|
|
|
|
$pred = new predeposit_helper($user_id);
|
|
|
$pred->bonus_expire($val);
|
|
|
- array_push($ids,$bonus->bonus_id());
|
|
|
+ $ids[] = $bonus->bonus_id();
|
|
|
|
|
|
if(isset($member_amount[$bonus->user_id()]) == false) {
|
|
|
$member_amount[$bonus->user_id()] = $amount;
|
|
@@ -84,6 +87,9 @@ class notify_helper
|
|
|
|
|
|
if (!empty($ids)) {
|
|
|
$mod_bonus->edit(array('bonus_id' => array('in', $ids)),array("expired" => 1));
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
|