예제 #1
0
 /**
  * @param float $adj
  * @param string $reason
  */
 private function AddMemberAdjustment($adj, $reason)
 {
     global $user;
     if (!class_exists('\\bbdkp\\controller\\adjustments\\Adjust')) {
         global $phpbb_root_path, $phpEx;
         require "{$phpbb_root_path}includes/bbdkp/controller/adjustments/Adjust.{$phpEx}";
     }
     $newadjust = new \bbdkp\controller\adjustments\Adjust();
     $newadjust->setMemberId($this->member_id);
     $newadjust->setAdjustmentValue($adj);
     $newadjust->setAdjustmentReason($reason);
     $newadjust->setCanDecay(0);
     $newadjust->setAdjDecay(0);
     $newadjust->setDecayTime(0);
     $newadjust->setAdjustmentDate($this->member_joindate);
     $newadjust->setAdjustmentGroupkey($this->gen_group_key($newadjust->getAdjustmentDate(), $newadjust->getAdjustmentReason(), $newadjust->getAdjustmentValue()));
     $newadjust->setAdjustmentAddedBy($user->data['username']);
     foreach ($newadjust->getDkpsys() as $pool) {
         $newadjust->setAdjustmentDkpid($pool['id']);
         $newadjust->add();
     }
     unset($newadjust);
 }