|
@@ -34,7 +34,7 @@ class hourControl extends BaseCronControl
|
|
|
$this->expired_bonus();
|
|
|
|
|
|
//更新全文搜索内容
|
|
|
- $this->_xs_update();
|
|
|
+ //$this->_xs_update();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -250,42 +250,7 @@ class hourControl extends BaseCronControl
|
|
|
*/
|
|
|
private function release_bonus()
|
|
|
{
|
|
|
- $bonus_type = Model('bonus_type');
|
|
|
-
|
|
|
- $one_hour = 60 * 60;
|
|
|
- $condition = array('remain_amount' => array('gt',0),'is_refund' => 0,'send_end_date' =>array('lt',time() - $one_hour));
|
|
|
- $bonus_types = $bonus_type->getTypeList($condition,'','*','',false);
|
|
|
- if(empty($bonus_types) || count($bonus_types) <= 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- foreach($bonus_types as $type)
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- $pred = new predeposit_helper($type['sender_id']);
|
|
|
-
|
|
|
- Model::beginTransaction();
|
|
|
- $bonus_type->edit(array('type_id' =>$type['type_id']),array('is_refund' => 1,'refund_time' => time()));
|
|
|
- if ($bonus_type->affected_rows() <= 0) {
|
|
|
- Model::rollback();
|
|
|
- $sresult = implode(',',$type);
|
|
|
- Log::record("bonus refund 更新状态失败,result:{$sresult}.");
|
|
|
- } else {
|
|
|
- $pred->bonus_refund($type);
|
|
|
- $condition = array('type_id' =>$type['type_id'],'bonus_status' => array('in','0,1'));
|
|
|
- Model('user_bonus')->where($condition)->delete();
|
|
|
- Model::commit();
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception $e)
|
|
|
- {
|
|
|
- Model::rollback();
|
|
|
-
|
|
|
- $sresult = implode(',',$type);
|
|
|
- Log::record('bonus refund : error:' . $e->getMessage() . " result:{$sresult}.");
|
|
|
- }
|
|
|
- }
|
|
|
+ notify_helper::release_bonus();
|
|
|
}
|
|
|
|
|
|
/**
|