本文整理汇总了PHP中Pager::calcPageInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Pager::calcPageInfo方法的具体用法?PHP Pager::calcPageInfo怎么用?PHP Pager::calcPageInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pager
的用法示例。
在下文中一共展示了Pager::calcPageInfo方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showWithdrawStatement
public function showWithdrawStatement($request, $response)
{
/*{{{*/
$nowPage = $request->page ? $request->page : 1;
$pageSize = 20;
$response->incomeAccountAmount = $this->space->getIncomeAccount()->amount;
$response->subsidyAccountAmount = $this->space->getSubsidyAccount()->amount;
$settleOrders = DAL::get()->find_all_by_spaceid('SettleOrder', $this->space->id);
$settleOrders = array_reverse($settleOrders);
$response->settleOrders = array_slice($settleOrders, ($nowPage - 1) * $pageSize, $pageSize);
$withdrawAmount = $noWithdrawAmount = 0;
$noWithdrawCnt = 0;
foreach ($settleOrders as $order) {
$noTaxAmount = $order->getAmountWithoutTax();
if ($order->isWithdraw()) {
$withdrawAmount += $noTaxAmount;
} else {
$noWithdrawCnt++;
}
}
$response->withdrawAmount = $withdrawAmount;
$response->noWithdrawCnt = $noWithdrawCnt;
$pageInfo = Pager::calcPageInfo(count($settleOrders), $nowPage, $pageSize);
$response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplateForSpace("showwithdrawstatement?actionclass={$request->actionclass}&page="), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']);
$response->actionClass = $request->actionclass;
}
示例2: newList
public function newList($request, $response)
{/*{{{*/
$response->controller = 'Index';
$response->object = 'flow';
$this->initialize($request, $response);
$this->forceSpaceModuleCheck('Case', $response);
//threads总数和flow总数
$threadsCount = ThreadClient::getInstance()->getUnSpacePostThreadsCount($this->_newSpace->id,
$this->_newUser->id, array('isBrowser'=>$this->_newUser->isNull()));
$flowsCount = FlowClient::getInstance()->getFlowListCount($this->_newSpace->id, array('p_type'=>'all', 'isBrowser'=>$this->_newUser->isNull()));
$response->flowCount = $threadsCount + $flowsCount;
$options = array();
$options['filterUserId'] = $this->_newUser->id;
$options['spaceId'] = $this->_newSpace->id;
$nowPage = intval($request->getRequest('p', 1));
$nowPage = $nowPage > 0 ? $nowPage : 1;
$pageSize = 25;
$freeFlowCount = FlowClient::getInstance()->getFreeFlowCntBySpace($this->_newSpace, $needCache = false);
$chargeFlowCount = FlowClient::getInstance()->getPaiedFlowCntBySpace($this->_newSpace, $needCache = false);
$response->chargeFlowCount = $chargeFlowCount;
$threadOptions = array();
$threadOptions['nowPage'] = $nowPage;
$threadOptions['pageSize'] = $pageSize;
if (false == $this->_newUser->isNull())
{
$threadOptions['excludeuser'] = $this->_newUser->id;
}
$unPostThreadList = ThreadClient::getInstance()->getUnSpacePostThreads($this->_newSpace->id, $this->_newUser->id, $threadOptions);
$myThreadIds = array();
if (false == $this->_newUser->isNull())
{
$myThreadIds = ThreadClient::getInstance()->getMyThreadInSpace($this->_newSpace->id, $this->_newUser->id);
}
$nowPageThreadCount = count($unPostThreadList);
if ($nowPageThreadCount < $pageSize)
{
if ($nowPageThreadCount > 0)
{
$options['from'] = 0;
$options['pageSize'] = $pageSize - $nowPageThreadCount;
}
else
{
$options['from'] = (($nowPage-1) * $pageSize == $threadsCount - count($myThreadIds)) ? 0 : (($nowPage - 1) * $pageSize - $threadsCount + count($myThreadIds)) ;
$options['pageSize'] = $pageSize;
}
$res = FlowClient::getInstance()->getAllFlows($options);
$flowList = $unPostThreadList + $res['refs'];
}
else
{
$flowList = $unPostThreadList;
}
$userSelfFlowCnt = 0;
if(false == $this->_newUser->isNull())
{
$userSelfFlowCnt = FlowClient::getInstance()->getAllFlowCnt(array('spaceId' => $this->_newSpace->id, 'userId' => $this->_newUser->id));
}
$pageInfo = Pager::calcPageInfo(($freeFlowCount + $chargeFlowCount + $threadsCount - $userSelfFlowCnt), $nowPage, $pageSize);
$response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("?&p="), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']);
$userSelf = array();
//当前患者的流
if($nowPage == 1 && $this->_newUser->isNull() == false && $this->_newUser->id != $this->_newSpace->user->id)
{
$userSelf = ThreadClient::getInstance()->getMyThreadAndFlowInSpace($this->_newSpace->id, $this->_newUser->id);
if(false == empty($userSelf))
{
$response->lastPostList = DoctorPatientPostClient::getInstance()->getLastPosts4Flows(array_keys($userSelf));
}
}
//取intention
$intentionList = array();
if(false == $this->_newUser->isNull())
{
$intentionList = IntentionClient::getInstance()->queryThreadIntentions($this->_newUser->id, '', '', $this->_newSpace->id);
}
$response->out = array_merge($intentionList, $userSelf , $flowList);
$response->flowList = $response->out;
$this->getCommonData($request, $response, $userSelf + $flowList);
}/*}}}*/
示例3: bookingProposalListOfPatient
public function bookingProposalListOfPatient($request, $response)
{
/*{{{*/
$response->_my_template = '/intention/list/bookingproposallistofpatient.php';
$patient = DAL::get()->find('Patient', $request->patientId);
$response->patient = $patient;
$patientIds = DAL::get()->find_id_samePhoneOrSameIdcardOf('Patient', $patient);
$ids = DAL::get()->find_id_by_servicedef_and_patientIds_and_status('Proposal', ServiceDef::TYPE_BOOKING, $patientIds);
//分页
$response->nowPage = $request->getRequest('nowPage', 1);
$pager = new XPager($response->nowPage, 20);
$pageInfo = Pager::calcPageInfo(count($ids), $pager->nowPage, $pager->pageSize);
$response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate('/intention/bookingproposallistofpatient?patientId=' . $patient->id . '&nowPage='), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']);
$ids = array_slice($ids, ($pager->nowPage - 1) * $pager->pageSize, $pager->pageSize, true);
$proposals = DAL::get()->find('Proposal', $ids);
krsort($proposals);
$response->dtos = BookingDto::createOfProposals($proposals, BookingDto::QUERY_STATUS_ALL);
}
示例4: getPageInfo
public function getPageInfo($sql, $binds = array(), $counter = '*')
{
/*{{{*/
if ('' == $this->nowPage || '' == $this->pageSize) {
return array('limit' => '');
}
return Pager::calcPageInfo($this->getTotalBySql($sql, $counter, $binds), $this->nowPage, $this->pageSize);
}
示例5: sendWhitoutSpace
private function sendWhitoutSpace($request, $response)
{
/*{{{*/
$chooseOtherDoctor = $request->getRequest('chooseOtherDoctor', false);
$presentId = $request->presentid;
$flows = FlowClient::getInstance()->getFlowListByUser($this->user->id, array('status' => DoctorPatientRef::STATUS_INIT));
if (0 == count($flows)) {
$response->canSend = false;
return;
} else {
if ($chooseOtherDoctor = false && 1 == count($flows)) {
$response->redirectUrl = array_pop($flows)->sendPresentUrl($presentId);
return;
}
}
$flowspostcnt = array();
foreach ($flows as $id => $flow) {
if (false == $flow->space->isNull() && $flow->space->isDoctor()) {
$flowspostcnt[$id] = $flow->postCount;
}
}
$refsList = array();
arsort($flowspostcnt, SORT_NUMERIC);
foreach ($flowspostcnt as $id => $cnt) {
$refsList[] = $flows[$id];
}
$response->chooseOtherDoctor = $chooseOtherDoctor;
$response->presentId = $presentId;
$nowPage = $request->getRequest('page', 1);
$pageSize = self::SELECT_DOCTOR_NUM;
$pageInfo = Pager::calcPageInfo(count($refsList), $nowPage, $pageSize);
$response->nowPage = $pageInfo['nowpage'];
$response->pages = $pageInfo['pages'];
$total = $pageInfo['total'];
$response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplateForSpace('/api/present/ajaxsendtomydoctor?presentid=' . $presentId . '&specified=false&chooseOtherDoctor=true&uname=' . $this->space->user->name . '&page=', 2, 3, 1, false), $pageInfo['nowpage'], $pageSize, $total);
$response->refs = array_slice($refsList, ($nowPage - 1) * $pageSize, $pageSize);
}
示例6: showPageInfo4ZhuanTiList
private function showPageInfo4ZhuanTiList($zhuanTiList,$request,$response)
{/*{{{*/
$nowPage = $request->getRequest('page', 1);
$pageSize = 50;
$response->zhuanTiList = array_slice($zhuanTiList, ($nowPage-1)*$pageSize, $pageSize);
$pageInfo = Pager::calcPageInfo(count($zhuanTiList), $nowPage, $pageSize);
$response->pageLink = PageNav::getNavLink(
PageNav::getPageNavTemplate('/paper/showcmstagtypelist?searchType='.$request->searchType.'&searchParam='.$request->searchParam.'&page='),
$pageInfo['nowpage'],$pageInfo['pagesize'],$pageInfo['total']);
}/*}}}*/
示例7: detail
public function detail($request, $response)
{/*{{{*/
$isPreview = $request->getRequest('ispreview', false);
$response->isPreview = $isPreview;
$thesis = DAL::get()->find('Thesis', $request->id);
if ($thesis instanceof Thesis && ($thesis->isOnline() || $isPreview))
{
if ($isPreview)
{
$thesis = $thesis->getPreviewObject();
}
if ($thesis->needRedirect())
{
$response->setRedirect($thesis->redirectLink);
return false;
}
$response->csss = array(
'http://i1.hdfimg.com/www/cms/css/content_thesis.css?20140722',
'http://i1.hdfimg.com/www/cms/css/thesis.css?20140722'
);
$thesisId = isset($thesis->id) ? $thesis->id : $thesis->thesisId;
$doctorObjRefList = DAL::get()->find_all_by_objid_and_relateobjtype('CmsObjRef', $thesisId, CmsTagType::DOCTOR);
$response->doctorObjRefList = $doctorObjRefList;
// $doctorObjRef = $thesis->getDoctorObjRef();
// if (false == $doctorObjRef->isNull())
// {
// $bindDoctor = DAL::get()->find('Doctor', $doctorObjRef->getRelateObj()->id);
// if ($bindDoctor instanceof Doctor)
// {
// $response->bindDoctor = $bindDoctor;
// $response->commentCnt = $bindDoctor->getCureThankLetterCount();
// $response->zhuanTis = ZhuanTiClient::getInstance()->getZhuanTiByDoctorId($bindDoctor->id, 10);;
// }
// }
//分页
$nowPage = $request->getRequest('page', 1);
$pageSize = 1;
$contentArr = explode('######', $thesis->content);
$count = count($contentArr);
$nowPage = ($nowPage > $count) ? 1 : $nowPage;
$response->content = $contentArr[$nowPage-1];
$disease = new NullEntity();
$diseaseObjRef = $thesis->getDiseaseObjRef();
if (false == $diseaseObjRef->isNull())
{
$disease = $diseaseObjRef->getRelateObj();
}
$flowList = array();
if ($disease instanceof Disease)
{
$this->getPhoneList($disease->id, $response);
$flowList = RelationSearchClient::getInstance()->getFlowListFromRelevantSearch($disease->name, 8);
$flowList = array_slice($flowList, 0, 8);
}
else
{
$diseaseIds_shuffle = self::$diseaseIds;
shuffle($diseaseIds_shuffle);
$this->getPhoneList(array_pop($diseaseIds_shuffle), $response);
$flowList = FlowClient::getInstance()->getLatestFlowList(8);
}
//网上咨询
$response->flowList = $flowList;
$response->disease = $disease;
$pageInfo = Pager::calcPageInfo($count, $nowPage, $pageSize);
$isPreviewFix = $isPreview?'ispreview=1&':'';
$response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("?{$isPreviewFix}page="),$pageInfo['nowpage'],$pageInfo['pagesize'],$pageInfo['total']);
$response->nowPage = $pageInfo['nowpage'];
$response->thesis = $thesis;
$masterObject = $thesis->getMasterObjRef()->getLinkObject();
$response->title = $thesis->title.'_'.$masterObject->getTitle().'_好大夫在线';
//$response->keywords = '';
//$response->description = '';
$response->masterObject = $masterObject;
// $thesisId = isset($thesis->id) ? $thesis->id : $thesis->thesisId;
// $paperIds = DAL::get()->queryRelateIdByObjId('CmsObjRef', $thesisId);
// if(false == empty($paperIds))
// {
// $res = ThesisClient::getInstance()->queryThesisListByType(array_shift($paperIds), array('relateType' => CmsTagType::PAPER, 'status' => Thesis::STATUS_ONLINE));
// $relatedThesisList = array_shift($res);
// $key = (isset($thesis->id)) ? 'id' : 'thesisId';
// $response->relatedThesisList = array_diff_key($relatedThesisList, array($thesis->$key => $relatedThesisList[$thesisId]));
// }
$relateDiseaseId = DAL::get()->queryDiseaseByThesis('thesis', $thesisId);
//.........这里部分代码省略.........
示例8: showDoctorWithdrawStatement
public function showDoctorWithdrawStatement($request, $response)
{/*{{{*/
$userName = $request->getRequest('userName', '');
$settleordertype = $request->settleordertype?$request->settleordertype:SettleOrder::REMIT_ALL;
$response->settleordertype = $settleordertype;
$response->beginDate = $request->beginDate;
$response->endDate = $request->endDate;
$response->userName = $userName;
if($userName)
{
$space = DAL::get()->find_by_userName('space', trim($userName));
if($space->isNull() == false)
{
$spaceId = $space->id;
}
else
{
$spaceUser = DAL::get()->find_by_name('User', $userName);
if($spaceUser->isNull() == false)
{
$spaceAccount = DAL::get()->find_by_spaceid('SpaceAccount', $spaceUser->id);
if($spaceAccount->isNull() == false)
{
$spaceId = $spaceAccount->spaceId;
}
else
{
$response->msg = '这个用户不是医生用户';
return ;
}
}
else
{
$response->msg = '没有这个医生!';
return ;
}
}
$nowPage = $request->page ? $request->page : 1;
$pageSize = 1000;
$settleOrders = DAL::get()->find_all_by_spaceid('SettleOrder', $spaceId);
$settleOrders = array_reverse($settleOrders);
$response->settleOrders = array_slice($settleOrders, ($nowPage-1)*$pageSize, $pageSize);
$pageInfo = Pager::calcPageInfo(count($settleOrders), $nowPage, $pageSize);
$response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("showdoctorwithdrawstatement?userName=$userName&settleordertype=$settleordertype&page="),$pageInfo['nowpage'],$pageInfo['pagesize'],$pageInfo['total']);
}
}/*}}}*/
示例9: loadMoreCaseOrPhoneOpenedDoctor
public function loadMoreCaseOrPhoneOpenedDoctor($request, $response)
{/*{{{*/
$this->initialize($request, $response);
//开通网上咨询的医生ids
$params = array();
$params['hospitalFacultyId'] = $this->hospitalFaculty->id;
$spaceList = SpaceClient::getInstance()->getCaseOpenedSpaceList($params);
$spaceList = $spaceList['spaceList'];
$caseDoctorIds = array();
foreach ($spaceList as $space)
{
if (true == $space->isCaseAndNewCaseOpen() && $space->user->allowAnswer() && 0 != $space->modulecase->allowNewMaxNumber)
{
$caseDoctorIds[] = $space->host->id;
}
}
//开通电话咨询的医生ids
$infos = DoctorClient::getInstance()->getDoctorListFor400Search(array(), $this->hospitalFaculty->hospital->province, $this->hospitalFaculty->faculty->name, $this->hospitalFaculty->hospital->commonName);
$phoneDoctorIds = $infos['doctorids'];
$caseOrPhoneDoctorIds = array_unique(array_merge($caseDoctorIds, $phoneDoctorIds));
$caseOrPhoneDoctorList = DAL::get()->find('doctor', $caseOrPhoneDoctorIds);
XString::sortArray($caseOrPhoneDoctorList, 'rank');
$nowPage = $request->getRequest('p', 1);
$response->resDoctorList = array_slice($caseOrPhoneDoctorList, ($nowPage-1)*(self::PAGESIZE_DOCTOR), self::PAGESIZE_DOCTOR);
$pageInfo = Pager::calcPageInfo(count($caseOrPhoneDoctorList), $nowPage, self::PAGESIZE_DOCTOR);
$response->nowPage = $nowPage;
$response->pages = $pageInfo['pages'];
$response->totalDoctorCnt = $pageInfo['total'];
$response->openCaseCount = $pageInfo['total'];
$response->loadUrl = $response->touchUrl.'/hospitalfaculty/loadmorecaseorphoneopeneddoctor?id='.$request->id.'&p=';
}/*}}}*/
示例10: showPageInfo4ZhuanTiList
private function showPageInfo4ZhuanTiList($zhuanTiList,$request,$response)
{/*{{{*/
$nowPage = $request->getRequest('page', 1);
$pageSize = 20;
$response->zhuanTiList = array_slice($zhuanTiList, ($nowPage-1)*$pageSize, $pageSize);
$pageInfo = Pager::calcPageInfo(count($zhuanTiList), $nowPage, $pageSize);
$response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate('/jibing/zhuanti/'.$this->disease->key.'.htm?&page='),
$pageInfo['nowpage'],$pageInfo['pagesize'],$pageInfo['total']);
}/*}}}*/
示例11: loadMoreRelatedCaseList
public function loadMoreRelatedCaseList($request, $response)
{/*{{{*/
$this->initialize($request, $response);
$nowPage = $request->getRequest('p', 1);
//疾病页2013版
$diseasePage = DAL::get()->find_by_disease('diseasepage', $this->disease->id);
if($diseasePage instanceof DiseasePage && $diseasePage->isOnlineOrPreview())
{
$res = $this->diseasePageCaseInfo();
}
else
{
$res = RelationSearchClient::getInstance()->getFlowListFromRelevantSearch($this->disease->name, 200);
}
$relatedCaseRes = array();
foreach ($res as $flow)
{
if (false == $flow->isNull())
{
$relatedCaseRes[] = $flow;
}
}
$response->flowList = array_slice($relatedCaseRes, ($nowPage-1)*(self::PAGESIZE_LIST), self::PAGESIZE_LIST);
$pageInfo = Pager::calcPageInfo(count($relatedCaseRes), $nowPage, self::PAGESIZE_LIST);
$response->nowPage = $nowPage;
$response->pages = $pageInfo['pages'];
$response->loadUrl = $response->touchUrl.'/disease/loadmorerelatedcaselist?key='.$request->key.'&p=';
}/*}}}*/
示例12: getPageInfo
private function getPageInfo($nowPage, $allCount)
{
/*{{{*/
$nowPage = $nowPage && $nowPage > 0 ? $nowPage : 1;
$allCount = $allCount && $allCount > 0 ? $allCount : 0;
$pageSize = self::PAGESIZE;
$pageInfo = Pager::calcPageInfo($allCount, $nowPage, $pageSize);
return $pageInfo;
}
示例13: getPagedUnFlows4Followup
private function getPagedUnFlows4Followup($space, $pageId, $pageSize)
{/*{{{*/
$res = NfsClient::getInstance()->getSpaceUnreadCaseFlows($space->id, $pageId, $pageSize);
$flowsList = $res['list'];
$unThreadList = array();
if ($pageId == 1) //第一页才取收费
{
$unPostThreadList = DAL::get()->find_all_spaceNotProcessList('proposal', $space, ServiceDef::TYPE_FLOW, array('isSpaceRead'=>0));
$unThreadList = $this->getRecommendCaseAndNewThread($unPostThreadList, $space->id, false);
}
$flowList = $this->getOldThreadLists($space->user->id, $flowsList);
$allList = array_merge($unThreadList, $flowList);
$pageInfo = Pager::calcPageInfo($res['pageInfo']['total'], $pageId, $pageSize);
$this->pageInfo = array("nowpage" => $pageId, 'pages' => $pageInfo['pages'],
'total'=>$pageInfo['total'], 'pagesize' => $pageSize);
return $allList;
}/*}}}*/