public function getRuleLog($rid, $uid = 0) { $log = array(); $uid = $uid ? $uid : Ibos::app()->user->uid; if ($rid && $uid) { $log = CreditRuleLog::model()->fetchRuleLog($rid, $uid); } return $log; }
protected function getCreditLog() { CacheUtil::load(array("creditrule")); $creditRule = CreditRule::model()->fetchAllSortByPk("rid"); $credits = Ibos::app()->setting->get("setting/extcredits"); $relateRules = CreditRuleLog::model()->fetchAllByAttributes(array("uid" => $this->getUid())); $criteria = array("condition" => "`uid` = :uid", "params" => array(":uid" => $this->getUid()), "order" => "dateline DESC"); $count = CreditLog::model()->count($criteria); $pages = PageUtil::create($count, 20); $criteria["limit"] = 20; $criteria["offset"] = $pages->getOffset(); $creditLog = CreditLog::model()->fetchAll($criteria); return array("creditLog" => $creditLog, "relateRules" => $relateRules, "credits" => $credits, "creditRule" => $creditRule, "pages" => $pages); }