Пример #1
0
 /**
  * 积分日志
  */
 public function logAction()
 {
     list($ctype, $timeStart, $timeEnd, $award) = $this->getInput(array('ctype', 'time_start', 'time_end', 'award'));
     $page = $this->getInput('page');
     $page < 1 && ($page = 1);
     $perpage = 20;
     list($offset, $limit) = Pw::page2limit($page, $perpage);
     Wind::import('SRV:credit.srv.PwCreditOperationConfig');
     Wind::import('SRV:credit.vo.PwCreditLogSc');
     $sc = new PwCreditLogSc();
     $url = array();
     if ($ctype) {
         $sc->setCtype($ctype);
         $url['ctype'] = $ctype;
     }
     if ($timeStart) {
         $sc->setCreateTimeStart(Pw::str2time($timeStart));
         $url['time_start'] = $timeStart;
     }
     if ($timeEnd) {
         $sc->setCreateTimeEnd(Pw::str2time($timeEnd));
         $url['time_end'] = $timeEnd;
     }
     if ($award) {
         $sc->setAward($award);
         $url['award'] = $award;
     }
     if ($sc->hasData()) {
         $sc->setUserid($this->loginUser->uid);
         $count = Wekit::load('credit.PwCreditLog')->countBySearch($sc);
         $log = Wekit::load('credit.PwCreditLog')->searchLog($sc, $limit, $offset);
     } else {
         $count = Wekit::load('credit.PwCreditLog')->countLogByUid($this->loginUser->uid);
         $log = Wekit::load('credit.PwCreditLog')->getLogByUid($this->loginUser->uid, $limit, $offset);
     }
     $this->setOutput($log, 'log');
     $this->setOutput(PwCreditBo::getInstance(), 'creditBo');
     $this->setOutput(PwCreditOperationConfig::getInstance(), 'coc');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($count, 'count');
     $this->setOutput($url, 'url');
     $this->setOutput($ctype, 'ctype');
     $this->setOutput($timeStart, 'timeStart');
     $this->setOutput($timeEnd, 'timeEnd');
     $this->setOutput($award, 'award');
     $this->setTemplate('profile_credit_log');
 }
Пример #2
0
 /**
  * 积分日志页面
  */
 public function logAction()
 {
     list($ctype, $time_start, $time_end, $award, $username, $uid) = $this->getInput(array('ctype', 'time_start', 'time_end', 'award', 'username', 'uid'));
     $page = $this->getInput('page');
     $page < 1 && ($page = 1);
     $perpage = 20;
     list($offset, $limit) = Pw::page2limit($page, $perpage);
     Wind::import('SRV:credit.bo.PwCreditBo');
     Wind::import('SRV:credit.vo.PwCreditLogSc');
     Wind::import('SRV:credit.srv.PwCreditOperationConfig');
     $sc = new PwCreditLogSc();
     $url = array();
     if ($ctype) {
         $sc->setCtype($ctype);
         $url['ctype'] = $ctype;
     }
     if ($time_start) {
         $sc->setCreateTimeStart(Pw::str2time($time_start));
         $url['time_start'] = $time_start;
     }
     if ($time_end) {
         $sc->setCreateTimeEnd(Pw::str2time($time_end));
         $url['time_end'] = $time_end;
     }
     if ($award) {
         $sc->setAward($award);
         $url['award'] = $award;
     }
     if ($username) {
         $user = Wekit::load('user.PwUser')->getUserByName($username);
         $sc->setUserid($user['uid']);
         // 			$url['uid'] = $user['uid'];
         $url['username'] = $username;
     }
     if ($uid) {
         $sc->setUserid($uid);
         $url['uid'] = $uid;
     }
     $count = Wekit::load('credit.PwCreditLog')->countBySearch($sc);
     $log = Wekit::load('credit.PwCreditLog')->searchLog($sc, $limit, $offset);
     $this->setCurrentTab('log');
     $this->setOutput(PwCreditBo::getInstance(), 'creditBo');
     $this->setOutput(PwCreditOperationConfig::getInstance(), 'coc');
     $this->setOutput($log, 'log');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($count, 'count');
     $this->setOutput($url, 'args');
 }