예제 #1
0
 /**
  * 更新用户积分
  * Enter description here ...
  * @param int $uid
  * @param int $cType (1-8)
  * @param int $value
  */
 public function editCredit($uid, $cType, $value, $isset = false)
 {
     Wind::import('WINDID:service.user.dm.WindidCreditDm');
     $dm = new WindidCreditDm($uid);
     if ($isset) {
         $dm->setCredit($cType, $value);
     } else {
         $dm->addCredit($cType, $value);
     }
     $result = $this->_getUserDs()->updateCredit($dm);
     if ($result instanceof WindidError) {
         return $result->getCode();
     }
     if (!$result) {
         return 0;
     }
     $this->_getNotifyClient()->send('editCredit', $uid);
     return (int) $result;
 }
예제 #2
0
 /**
  * 更新用户积分
  *
  * @param int $uid
  * @param int $cType (1-8)
  * @param int $value
  */
 public function editCredit($uid, $cType, $value, $isset = false)
 {
     Wind::import('WSRV:user.dm.WindidCreditDm');
     $dm = new WindidCreditDm($uid);
     if ($isset) {
         $dm->setCredit($cType, $value);
     } else {
         $dm->addCredit($cType, $value);
     }
     return $this->_getUserDs()->updateCredit($dm);
 }
예제 #3
0
 public function editDmCreditAction()
 {
     $uid = (int) $this->getInput('uid', 'post');
     list($set, $add) = $this->getInput(array('set', 'add'), 'post');
     Wind::import('WSRV:user.dm.WindidCreditDm');
     $dm = new WindidCreditDm($uid);
     if ($set && is_array($set)) {
         foreach ($set as $key => $value) {
             $dm->setCredit($key, $value);
         }
     }
     if ($add && is_array($add)) {
         foreach ($add as $key => $value) {
             $dm->addCredit($key, $value);
         }
     }
     $result = $this->_getUserDs()->updateCredit($dm);
     if ($result instanceof WindidError) {
         $this->output($result->getCode());
     }
     if ($result) {
         $this->_getNotifyService()->send('editCredit', array('uid' => $uid), $this->appid);
     }
     $this->output(WindidUtility::result($result));
 }