本文整理汇总了PHP中Pw类的典型用法代码示例。如果您正苦于以下问题:PHP Pw类的具体用法?PHP Pw怎么用?PHP Pw使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pw类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: editAction
public function editAction()
{
$tagId = $this->getInput('id', 'Request');
$tagName = $this->getInput('name', 'Request');
$tagType = $this->getInput('type', 'Request');
if ($this->getInput('type', 'post') === 'do') {
$tagName = $this->getInput('tagname', 'post');
if (empty($tagName)) {
$this->showError('请输入Tag名称');
return;
}
$hasDuplicate = $this->_getTagDs()->checkDuplicateName($tagName);
if ($hasDuplicate) {
$this->showError('Tag:' . '"' . $tagName . '"' . '已存在');
return;
}
$dm = new App_Tag_Dm();
$dm->setTagName($tagName)->setLastUpdateTime(Pw::getTime());
$this->_getTagDs()->update($tagId, $dm);
$this->showMessage('更新成功');
} else {
$this->setOutput($tagId, 'tagId');
$this->setOutput($tagName, 'tagName');
$this->setOutput($tagType, 'tagType');
}
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:26,代码来源:TagController.php
示例2: __construct
public function __construct($uid)
{
$this->ftype = array('jpg' => 2000, 'png' => 2000, 'jpeg' => 2000);
$this->mime = array('image/jpeg', 'image/png', 'image/jpg');
$this->uid = $uid;
$this->udir = Pw::getUserDir($this->uid);
}
开发者ID:ccq18,项目名称:EduSoho,代码行数:7,代码来源:WindidAvatarUpload.php
示例3: getResponseInfo
/**
* 获取淘宝响应信息 如果oauth2正常流程,可以走curl_init
*/
public function getResponseInfo()
{
$result = $this->checkStatus();
if ($result !== true) {
return new PwError($result);
}
$sessionId = Pw::getCookie($this->_getLoginSessionService()->getCookieName());
$sessionInfo = App_Account_LoginSessionBo::getInstance($sessionId)->getSession();
if (!$sessionId || !$sessionInfo) {
return new PwError('验证会话失败,请重试');
}
list($top_parameters, $top_sign) = array(trim($_REQUEST['top_parameters']), trim($_REQUEST['top_sign']));
if ($this->_checkSign() === false) {
return new PwError('与淘宝通信失败,请重试');
}
$userInfo = $this->_getUserInfo();
if ($userInfo === false) {
return new PwError('获取用户信息失败,请重试');
}
list($user_id, $nick) = $userInfo;
//更新数据库
$info = $this->_getTaobaoUserInfoDs()->get($user_id);
if (!$info) {
$dm = new App_Account_TaobaoUserInfoDm();
$dm->setUserId($user_id)->setNick($nick)->setCreateAt(Pw::getTime());
$this->_getTaobaoUserInfoDs()->add($dm);
}
//更新session
$this->updateSession($user_id, $nick, 'taobao');
return true;
}
开发者ID:sanzhumu,项目名称:nextwind,代码行数:34,代码来源:App_Account_TaobaoService.php
示例4: _getActiveUser
protected function _getActiveUser($fid, $day, $num)
{
$time = Pw::getTime() - $day * 86400;
$array = array();
$thread = Wekit::load('forum.PwThreadExpand')->countUserThreadByFidAndTime($fid, $time, $num);
$post = Wekit::load('forum.PwThreadExpand')->countUserPostByFidAndTime($fid, $time, $num);
foreach ($thread as $key => $value) {
if (!$key) {
continue;
}
$array[$key] = $value['count'];
}
foreach ($post as $key => $value) {
if (!$key) {
continue;
}
if (isset($array[$key])) {
$array[$key] += $value['count'];
} else {
$array[$key] = $value['count'];
}
}
arsort($array);
return array_slice($array, 0, $num, true);
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:25,代码来源:PwForumUserService.php
示例5: afterAction
public function afterAction($handlerAdapter)
{
parent::afterAction($handlerAdapter);
$debug = Wekit::C('site', 'debug') || !Wekit::C('site', 'css.compress');
Wekit::setGlobal(array('debug' => $debug ? '/dev' : '/build'), 'theme');
$this->setTheme('site', null);
/* @var $resource WindLangResource */
$resource = Wind::getComponent('i18n');
$_error = $this->getForward()->getVars('message');
if ($resource !== null) {
foreach ($_error as $key => $value) {
if (is_array($value)) {
list($value, $var) = $value;
} else {
$var = array();
}
$message = $resource->getMessage($value, $var);
$message && ($_error[$key] = $message);
}
}
$this->getForward()->setVars(array('message' => $_error, '__error' => ''));
$type = $this->getRequest()->getAcceptTypes();
// 如果是含有上传的递交,不能采用ajax的方式递交,需要以html的方式递交,并且返回的结果需要是json格式,将以json=1传递过来标志
$json = $this->getInput('_json');
$requestJson = $this->getRequest()->getIsAjaxRequest() && strpos(strtolower($type), "application/json") !== false;
if ($requestJson || $json == 1) {
$this->getResponse()->setHeader('Content-type', 'application/json; charset=' . Wekit::V('charset'));
echo Pw::jsonEncode($this->getForward()->getVars());
exit;
}
}
开发者ID:BTSnowball,项目名称:BTSnowball_Users_Hand,代码行数:31,代码来源:PwErrorController.php
示例6: sendNotice
/**
* 发送通知
* @param int $uid
* @param string $type
* @param int $param
* @param array $extendParams
* @param $updateUnRead 是否更新未读数
*/
public function sendNotice($uid, $type, $param = 0, $extendParams = array(), $updateUnRead = true)
{
$action = $this->_getAction($type);
if (!$action) {
return new PwError('MESSAGE::notice.type.undefined');
}
$typeId = $this->_getTypeId($type);
// 看是否发通知
if ($this->_checkPrivate($uid, $typeId) !== true) {
return false;
}
//aggregated notice
Wind::import('SRV:message.dm.PwMessageNoticesDm');
$dm = new PwMessageNoticesDm();
$action->aggregate && ($notice = $this->_getNoticesDs()->getNoticeByUid($uid, $typeId, $param));
$extendParams = $action->formatExtendParams($extendParams, $notice);
$noticeTitle = $action->buildTitle($param, $extendParams, $notice);
$dm->setToUid($uid)->setRead(0)->setType($typeId)->setParam($param)->setExtendParams($extendParams)->setTitle($noticeTitle);
if (!$notice) {
$noticeId = $this->_getNoticesDs()->addNotice($dm);
} else {
$dm->setId($notice['id']);
$dm->setModifiedTime(Pw::getTime());
$this->_getNoticesDs()->updateNotice($dm);
$noticeId = $notice['id'];
}
//更新通知未读数
if ($updateUnRead && (!$notice || $notice['is_read'])) {
Wind::import('SRV:user.dm.PwUserInfoDm');
$dm = new PwUserInfoDm($uid);
$dm->addNotice(1);
$this->_getUserDs()->editUser($dm, PwUser::FETCH_DATA);
}
return true;
}
开发者ID:chendong0444,项目名称:phpwind,代码行数:43,代码来源:PwNoticeService.php
示例7: afterRegister
public function afterRegister($userDm)
{
if ($this->bp->config['type'] != 2) {
return false;
}
/* @var $inviteDs PwInviteCode */
$inviteDs = Wekit::load('invite.PwInviteCode');
if ($this->inviteInfo['created_userid']) {
$codeDm = new PwInviteCodeDm();
$codeDm->setInvitedUid($userDm->uid)->setModifiedTime(Pw::getTime())->setIfused(1)->setCode($this->code);
//别人赠送的邀请码
$inviteDs->updateCode($codeDm);
$creditType = $this->bp->config['invite.reward.credit.type'];
$creditNum = $this->bp->config['invite.reward.credit.num'];
//邀请人获得加奖励
//[积分日志] 成功邀请好友积分奖励
/* @var $creditBo PwCreditBo */
$creditBo = PwCreditBo::getInstance();
$creditBo->addLog('invite_reward', array($creditType => $creditNum), new PwUserBo($this->inviteInfo['created_userid']), array('friend' => $userDm->getField('username')));
$creditBo->set($this->inviteInfo['created_userid'], $creditType, $creditNum);
//邀请成功相互关注 被邀请者关注邀请者
/* @var $attention PwAttentionService */
$attention = Wekit::load('attention.srv.PwAttentionService');
$attention->addFollow($userDm->uid, $this->inviteInfo['created_userid']);
// $attention->addFollow($this->inviteInfo['created_userid'], $userDm->uid);
} else {
$codeDm = new PwInviteCodeDm();
$codeDm->setInvitedUid($userDm->uid)->setIfused(1)->setModifiedTime(Pw::getTime())->setCreateUid($userDm->uid)->setCode($this->code);
//自己购买的邀请码
$inviteDs->updateCode($codeDm);
}
return true;
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:33,代码来源:PwRegisterDoInvite.php
示例8: run
public function run()
{
$page = (int) $this->getInput('page', 'get');
$perpage = 10;
$args = array();
$page = $page > 1 ? $page : 1;
list($start, $perpage) = Pw::page2limit($page, $perpage);
$list = $this->_getPageDs()->getPageList(PwDesignPage::SYSTEM, $start, $perpage);
$count = $this->_getPageDs()->countPage(PwDesignPage::SYSTEM);
$sysPage = Wekit::load('design.srv.router.PwDesignRouter')->get();
foreach ($list as &$v) {
if (isset($sysPage[$v['page_router']])) {
list($pagename, $unique) = $sysPage[$v['page_router']];
}
list($m, $c, $a, $id) = explode('|', $v['page_router']);
if ($unique) {
$v['url'] = WindUrlHelper::createUrl($m . '/' . $c . '/' . $a, array($unique => $v['page_unique']), '', 'pw');
} else {
$v['url'] = WindUrlHelper::createUrl($m . '/' . $c . '/' . $a, array(), '', 'pw');
}
$sep = strpos($v['url'], '?') === false ? '?' : '&';
$v['designurl'] = $v['url'] . $sep . 'design=1';
}
$this->setOutput($list, 'list');
$this->setOutput($count, 'count');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput(ceil($count / $perpage), 'totalpage');
$this->setOutput('design/page/run', 'pageurl');
}
开发者ID:chendong0444,项目名称:phpwind,代码行数:30,代码来源:PageController.php
示例9: run
public function run()
{
list($type, $page) = $this->getInput(array('type', 'page'));
$page = intval($page);
$page < 1 && ($page = 1);
$perpage = 20;
list($start, $limit) = Pw::page2limit($page, $perpage);
$noticeList = $this->_getNoticeDs()->getNotices($this->loginUser->uid, $type, $start, $limit);
$noticeList = $this->_getNoticeService()->formatNoticeList($noticeList);
$typeCounts = $this->_getNoticeService()->countNoticesByType($this->loginUser->uid);
//类型
$typeid = intval($type);
//获取未读通知数
$unreadCount = $this->_getNoticeDs()->getUnreadNoticeCount($this->loginUser->uid);
$this->_readNoticeList($unreadCount, $noticeList);
//count
$count = intval($typeCounts[$typeid]['count']);
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput($count, 'count');
$this->setOutput(ceil($count / $perpage), 'totalpage');
$this->setOutput(array('type' => $typeid), 'args');
$this->setOutput($typeid, 'typeid');
$this->setOutput($typeCounts, 'typeCounts');
$this->setOutput($noticeList, 'noticeList');
// seo设置
Wind::import('SRV:seo.bo.PwSeoBo');
$seoBo = PwSeoBo::getInstance();
$lang = Wind::getComponent('i18n');
$seoBo->setCustomSeo($lang->getMessage('SEO:mess.notice.run.title'), '', '');
Wekit::setV('seo', $seoBo);
}
开发者ID:YoursBoss,项目名称:nextwind,代码行数:32,代码来源:NoticeController.php
示例10: getData
protected function getData($field, $order, $limit, $offset)
{
Wind::import('SRV:tag.vo.PwTagSo');
$so = new PwTagSo();
$field['tag_ids'] && $so->setTagId(explode(' ', $field['tag_ids']));
$field['category_id'] && $so->setCategoryId($field['category_id']);
$so->setIflogo($field['islogo']);
$so->setIfhot(1);
switch ($field['order']) {
case 0:
$so->orderbyCreatedTime();
break;
case 1:
$so->orderbyAttentionCount();
break;
case 2:
$so->orderbyContentCount();
break;
}
$list = Wekit::load('tag.PwTagSearch')->searchTag($so, $limit, $offset);
if (!$list) {
return array();
}
foreach ($list as $k => $v) {
$list[$k]['tagid'] = $v['tag_id'];
$list[$k]['tag_name'] = $this->_formatTitle($v['tag_name']);
$list[$k]['url'] = WindUrlHelper::createUrl('tag/index/view', array('name' => $v['tag_name']), '', 'pw');
$list[$k]['logo'] = Pw::getPath($v['tag_logo']);
$list[$k]['attention_count'] = $v['attention_count'];
$list[$k]['content_count'] = $v['content_count'];
$list[$k]['excerpt'] = $v['excerpt'];
$list[$k]['thumb_attach'] = $v['tag_logo'] ? $v['tag_logo'] : '';
}
return $list;
}
开发者ID:chendong0444,项目名称:phpwind,代码行数:35,代码来源:PwDesignTagDataService.php
示例11: allistAction
public function allistAction()
{
$page = $this->getInput('page');
$schoolId = $this->getCurrentSchoolId();
$schoolName = $this->setAreaFilterWidgetData();
$count = $this->_getCateWeekReportDs()->countCakeWeekBySchoolId($schoolId);
if (0 < $count) {
$totalPage = ceil($count / $this->pageNumber);
$page > $totalPage && ($page = $totalPage);
list($start, $limit) = Pw::page2limit($page, $this->pageNumber);
if ($page <= 0) {
$page = 1;
}
}
$allCateWeekList = $this->_getCateWeekReportDs()->getCakeWeekBySchoolId($schoolId, $start, $limit);
foreach ($allCateWeekList as $key => $value) {
$date = substr($value['releasedate'], 0, 10);
$allCateWeekList[$key]['date'] = $date;
$allCateWeekList[$key]['imageurl'] = 'src/extensions/4tschool' . str_replace('\\', '/', $value['breviaryphoto']);
}
$this->setOutput($allCateWeekList, "allCateWeekList");
$this->setOutput($count, 'count');
$this->setOutput($page, 'page');
$this->setOutput($this->pageNumber, 'perPage');
$this->setOutput($schoolId, 'schoolId');
//SEO Information
$SEOTitleKeyword = '美食文章 - ' . $schoolName . '美食外卖';
$this->setOutput($SEOTitleKeyword, 'SEOTitle');
$this->setOutput($SEOTitleKeyword, 'SEOKeyword');
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:30,代码来源:CateweekdetailController.php
示例12: memberAction
/**
* 查看投票参与人员
*
* @return void
*/
public function memberAction()
{
if (!$this->loginUser->getPermission('allow_view_vote')) {
$this->showError('VOTE:group.not.allow.view');
}
list($pollid, $optionid) = $this->getInput(array('pollid', 'optionid'), 'get');
$poll = $this->_getPollService()->getPoll($pollid);
if (!$poll) {
$this->showError('VOTE:thread.not.exist');
}
//$isVoted = $this->_getPollVoterDs()->isVoted($this->loginUser->uid, $pollid);
//$allowView = (!$poll['isafter_view'] || $isVoted);
//if (!$allowView) $this->showError('VOTE:not.allow.view');
$page = $this->getInput('page');
$page > 1 && ($this->page = $page);
list($start, $limit) = Pw::page2limit($this->page, $this->perpage);
$total = $this->_getPollVoterDs()->countUserByOptionid($optionid);
$vote = $total ? $this->_getPollVoterDs()->getUserByOptionid($optionid, $limit, $start) : array();
$uids = $userName = array();
foreach ($vote as $value) {
$uids[] = $value['uid'];
}
$userList = $uids ? $this->_getUserDs()->fetchUserByUid($uids) : array();
foreach ($userList as $value) {
$userName[$value['uid']] = $value['username'];
}
$this->_getPollService()->resetOptionVotedNum($optionid);
$this->setOutput(array('data' => $userName));
$this->showMessage('success');
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:35,代码来源:IndexController.php
示例13: run
public function run()
{
$this->_setNavType('promotionalmanage');
$choosenSchoolId = -1;
$promotionalstatus = -1;
if ($this->getInput('type', 'post') === 'do') {
list($choosenSchoolId, $promotionalstatus) = $this->getInput(array('choosenSchoolId', 'promotionalstatus'), 'post');
}
$page = $this->getInput('page');
$searchCondition = array('choosenSchoolId' => $choosenSchoolId, 'promotionalstatus' => $promotionalstatus);
$count = $this->_getPromotionalmanageDs()->countPromotional($searchCondition);
if (0 < $count) {
$totalPage = ceil($count / $this->pageNumber);
$page > $totalPage && ($page = $totalPage);
list($start, $limit) = Pw::page2limit($page, $this->pageNumber);
if ($page <= 0) {
$page = 1;
}
}
$shopPromotionalList = $this->_getPromotionalmanageDs()->getAllShopsPromotional($searchCondition, $start, $limit);
$shopPromotionalList = array_values($shopPromotionalList);
$this->getSchoolList();
$this->setOutput($shopPromotionalList, 'shopPromotionalList');
$this->setOutput($searchCondition, 'searchCondition');
$this->setOutput($count, 'count');
$this->setOutput($page, 'page');
$this->setOutput($this->pageNumber, 'perPage');
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:28,代码来源:PromotionalmanageController.php
示例14: doPay
/**
* 为了成长付出的代价
*/
public function doPay($starttime, $currency)
{
$tdTime = Pw::getTdtime();
$set_a = array();
Wind::import('EXT:signature.service.dm.App_Signature_dm');
$dm = new App_Signature_dm($this->info['uid']);
if (!$starttime) {
$set_a = array($tdTime, $this->money);
} elseif (!$this->money || strpos($this->groups, ',' . $this->info['groupid'] . ',') === false) {
$dm->setStartTime(0);
$this->_userDs()->editUser($dm, PwUser::FETCH_DATA);
} else {
$days = floor(($tdTime - $starttime) / 86400);
$cost = $days * $this->money;
$cost < 0 && ($cost = 0);
if ($currency >= $cost) {
$set_a = array($tdTime, $cost);
} else {
$cost = $currency - $currency % $this->money;
$cost < 0 && ($cost = 0);
$set_a = array(0, $cost);
}
}
if ($set_a) {
/* @var $creditBo PwCreditBo */
$creditBo = PwCreditBo::getInstance();
$creditBo->set($this->info['uid'], $this->moneyType, -$set_a[1]);
$dm->setStartTime($set_a[0]);
$this->_userDs()->editUser($dm, PwUser::FETCH_DATA);
}
return true;
}
开发者ID:sanzhumu,项目名称:nextwind,代码行数:35,代码来源:App_Signature_Pay.php
示例15: run
public function run()
{
$page = (int) $this->getInput('page', 'get');
$flag = $this->getInput('flag');
$compid = (int) $this->getInput('compid');
$compname = $this->getInput('compname');
$perpage = 10;
$args = array();
$page = $page > 1 ? $page : 1;
list($start, $perpage) = Pw::page2limit($page, $perpage);
Wind::import('SRV:design.srv.vo.PwDesignComponentSo');
$vo = new PwDesignComponentSo();
if ($flag) {
$vo->setModelFlag($flag);
$args['flag'] = $flag;
}
if ($compid > 0) {
$vo->setCompid($compid);
$args['compid'] = $compid;
}
if ($compname) {
$vo->setCompname($compname);
$args['compname'] = $compname;
}
$list = $this->_getDesignComponentDs()->searchComponent($vo, $start, $perpage);
$count = $this->_getDesignComponentDs()->countComponent($vo);
$models = $this->_getDesignService()->getModelList();
$this->setOutput($args, 'args');
$this->setOutput($flag, 'flag');
$this->setOutput($list, 'list');
$this->setOutput($models, 'models');
$this->setOutput($count, 'count');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
}
开发者ID:YoursBoss,项目名称:nextwind,代码行数:35,代码来源:ComponentController.php
示例16: run
public function run()
{
$page = $this->getInput('page');
$this->page = $page < 1 ? 1 : intval($page);
list($start, $limit) = Pw::page2limit($this->page, $this->perpage);
$timestamp = PW::getTime();
$startTime = $timestamp - 7 * 86400;
$endTime = $timestamp;
$total = $this->_getPollDs()->countPollByTime($startTime, $endTime);
$pollInfo = array();
if ($total) {
Wind::import('SRV:poll.srv.dataSource.PwFetchPollByTime');
$pollDisplay = new PwPollDisplay(new PwFetchPollByTime($startTime, $endTime, $limit, $start, array('voter_num' => 0, 'created_time' => 0)));
$pollInfo = $this->_buildPoll($pollDisplay->gather());
}
$latestPollDisplay = new PwPollDisplay(new PwFetchPollByOrder(10, 0, array('created_time' => '0')));
$latestPoll = $latestPollDisplay->gather();
$this->setOutput($total, 'total');
$this->setOutput($pollInfo, 'pollInfo');
$this->setOutput($latestPoll, 'latestPoll');
$this->setOutput($this->page, 'page');
$this->setOutput($this->perpage, 'perpage');
$this->setOutput(array('allowview' => $this->loginUser->getPermission('allow_view_vote'), 'allowvote' => $this->loginUser->getPermission('allow_participate_vote')), 'pollGroup');
// seo设置
Wind::import('SRV:seo.bo.PwSeoBo');
$seoBo = PwSeoBo::getInstance();
$lang = Wind::getComponent('i18n');
if ($this->page > 1) {
$seoBo->setCustomSeo($lang->getMessage('SEO:vote.hot.run.page.title', array($this->page)), $lang->getMessage('vote.hot.run.description'), '');
} else {
$seoBo->setCustomSeo($lang->getMessage('SEO:vote.hot.run.title'), '', $lang->getMessage('SEO:vote.hot.run.description'));
}
Wekit::setV('seo', $seoBo);
}
开发者ID:chendong0444,项目名称:phpwind,代码行数:34,代码来源:HotController.php
示例17: run
public function run()
{
$this->_setNavType('cateweekreport');
$allSchool = $this->_get4TSchoolDS()->getOpenedSchools();
$allSchool = array_values($allSchool);
$cateTypeClass = $this->setCateTypeCommonClass();
$this->setOutput($allSchool, 'allSchool');
$this->setOutput($cateTypeClass, 'cateTypeClass');
$choosenSchoolId = -1;
$typename = -1;
$audited = -1;
$released = -1;
if ($this->getInput('type', 'post') === 'do') {
list($choosenSchoolId, $typename, $audited, $released) = $this->getInput(array('choosenSchoolId', 'typename', 'audited', 'released'), 'post');
}
$page = $this->getInput('page');
$searchCondition = array('choosenSchoolId' => $choosenSchoolId, 'typename' => $typename, 'audited' => $audited, 'released' => $released);
$count = $this->_getCateWeekReportDs()->countCateWeek($searchCondition);
if (0 < $count) {
$totalPage = ceil($count / $this->pageNumber);
$page > $totalPage && ($page = $totalPage);
list($start, $limit) = Pw::page2limit($page, $this->pageNumber);
if ($page <= 0) {
$page = 1;
}
}
$cateWeekReportList = $this->_getCateWeekReportDs()->getSearchCateWeekData($searchCondition, $start, $limit);
$cateWeekReportList = array_values($cateWeekReportList);
$this->setOutput($searchCondition, 'searchCondition');
$this->setOutput($cateWeekReportList, 'cateWeekReportList');
$this->setOutput($count, 'count');
$this->setOutput($page, 'page');
$this->setOutput($this->pageNumber, 'perPage');
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:34,代码来源:CateweekreportController.php
示例18: run
public function run()
{
list($page, $perpage, $username, $starttime, $endtime, $keyword) = $this->getInput(array('page', 'perpage', 'username', 'starttime', 'endtime', 'keyword'));
$starttime && ($pwStartTime = Pw::str2time($starttime));
$endtime && ($pwEndTime = Pw::str2time($endtime));
$page = $page ? $page : 1;
$perpage = $perpage ? $perpage : $this->perpage;
list($start, $limit) = Pw::page2limit($page, $perpage);
if ($username) {
$userinfo = $this->_getUserDs()->getUserByName($username);
$fromUid = $userinfo['uid'] ? $userinfo['uid'] : 0;
}
Wind::import('WINDID:service.message.srv.vo.WindidMessageSo');
$vo = new WindidMessageSo();
$endtime && $vo->setEndTime($endtime);
$fromUid && $vo->setFromUid($fromUid);
$keyword && $vo->setKeyword($keyword);
$starttime && $vo->setStarttime($starttime);
$messages = $this->_getMessageDs()->searchMessage($vo, $start, $limit);
$count = $this->_getMessageDs()->countMessage($vo);
foreach ($messages as $k => $v) {
$uids[] = $v['from_uid'];
}
$users = $this->_getUserDs()->fetchUserByUid($uids);
foreach ($messages as $k => $v) {
$messages[$k]['username'] = $users[$v['from_uid']]['username'];
}
$this->setOutput($count, 'count');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput(array('keyword' => $keyword, 'username' => $username, 'starttime' => $starttime, 'endtime' => $endtime), 'args');
$this->setOutput($messages, 'messages');
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:33,代码来源:MessagesController.php
示例19: __construct
/**
* 初始化安装程序
*/
public function __construct()
{
$this->_appId = 'L000' . time() . WindUtility::generateRandStr(4);
$this->_config = @(include Wind::getRealPath(self::CONF_PATH, true));
$this->tmpPath = Wind::getRealPath($this->getConfig('tmp_dir') . '.' . Pw::getTime(), false);
$this->tmpInstallLog = Wind::getRealPath($this->getConfig('log_dir'), false);
}
开发者ID:fanqimeng,项目名称:4tweb,代码行数:10,代码来源:PwInstallApplication.php
示例20: _buildSignKey
private function _buildSignKey($list)
{
$_username = array();
$_tids = array();
foreach ($list as $k => $v) {
$_tids[] = $v['lastpost_tid'];
}
$thread = $this->_getThread($_tids);
foreach ($list as $k => $v) {
$list[$k]['name'] = $this->_filterForumHtml($v['name']);
if ($v['type'] == 'category') {
$list[$k]['forum_url'] = WindUrlHelper::createUrl('bbs/cate/run', array('fid' => $v['fid']), '', 'pw');
} else {
$list[$k]['forum_url'] = WindUrlHelper::createUrl('bbs/thread/run', array('fid' => $v['fid']), '', 'pw');
}
$list[$k]['descrip'] = $this->_formatDes($v['descrip']);
$list[$k]['logo'] = $v['logo'] ? Pw::getPath($v['logo']) : '';
$lastthread = $thread[$v['lastpost_tid']];
$list[$k]['lastpost_time'] = $this->_formatTime($lastthread['lastpost_time']);
$list[$k]['lastpost_smallavatar'] = $lastthread['lastpost_userid'] ? Pw::getAvatar($lastthread['lastpost_userid'], 'small') : '';
$list[$k]['lastpost_middleavatar'] = $lastthread['lastpost_userid'] ? Pw::getAvatar($lastthread['lastpost_userid'], 'middle') : '';
$list[$k]['lastpost_userid'] = $lastthread['lastpost_userid'];
$list[$k]['lastpost_username'] = $lastthread['lastpost_username'];
$list[$k]['lastpost_space'] = $lastthread['lastpost_userid'] ? WindUrlHelper::createUrl('space/index/run', array('uid' => $lastthread['lastpost_userid']), '', 'pw') : '';
$list[$k]['lastthread_space'] = $lastthread['created_userid'] ? WindUrlHelper::createUrl('space/index/run', array('uid' => $lastthread['created_userid']), '', 'pw') : '';
$list[$k]['lastthread_smallavatar'] = $lastthread['created_userid'] ? Pw::getAvatar($lastthread['created_userid'], 'small') : '';
$list[$k]['lastthread_middleavatar'] = $lastthread['created_userid'] ? Pw::getAvatar($lastthread['created_userid'], 'middle') : '';
$list[$k]['lastthread_username'] = $lastthread['created_username'];
$list[$k]['lastthread_time'] = $this->_formatTime($lastthread['created_time']);
$list[$k]['lastthread'] = $this->_formatTitle($lastthread['subject']);
}
return $list;
}
开发者ID:chendong0444,项目名称:phpwind,代码行数:33,代码来源:PwDesignForumDataService.php
注:本文中的Pw类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论