当前位置: 首页>>代码示例>>PHP>>正文


PHP Pw::getTdtime方法代码示例

本文整理汇总了PHP中Pw::getTdtime方法的典型用法代码示例。如果您正苦于以下问题:PHP Pw::getTdtime方法的具体用法?PHP Pw::getTdtime怎么用?PHP Pw::getTdtime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pw的用法示例。


在下文中一共展示了Pw::getTdtime方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: welcome

 public function welcome(PwUserBo $userBo, $ip)
 {
     $config = Wekit::C('site');
     $info = $userBo->info;
     $moneyType = $config['app.signature.moneytype'];
     $money = $config['app.signature.money'];
     $in_group = strpos($config['app.signature.groups'], ',' . $info['groupid'] . ',') !== false;
     $neverPay = !$info['app_signature_starttime'] && $money && $in_group && $info['credit' . $moneyType] > $money;
     $everPay = $info['app_signature_starttime'] && $info['app_signature_starttime'] != Pw::getTdtime();
     if ($neverPay || $everPay) {
         Wind::import('EXT:signature.service.srv.App_Signature_Pay');
         $srv = new App_Signature_Pay($info, $config);
         $srv->doPay($info['app_signature_starttime'], $info['credit' . $moneyType]);
     }
 }
开发者ID:sanzhumu,项目名称:nextwind,代码行数:15,代码来源:App_Signaturelogin_WelcomeDo.php

示例3: bulidUsers

 public function bulidUsers($users)
 {
     $config = Wekit::C('site');
     foreach ($users as $key => $value) {
         if ($value['bbs_sign']) {
             $moneyType = $config['app.signature.moneytype'];
             $money = $config['app.signature.money'];
             $in_group = strpos($config['app.signature.groups'], ',' . $value['groupid'] . ',') !== false;
             $payCredit = !$value['app_signature_starttime'] || $value['credit' . $moneyType] < (Pw::getTdtime() - $value['app_signature_starttime']) / 86400 * $money;
             if ($money && $in_group && $payCredit) {
                 $value['bbs_sign'] = '';
             }
         }
         $users[$key] = $value;
     }
     return $users;
 }
开发者ID:sanzhumu,项目名称:nextwind,代码行数:17,代码来源:App_SignaturePwThreadDisplayDo.php

示例4: check

 /**
  * @see PwUploadAction.check
  */
 public function check()
 {
     if (!$this->user->isExists()) {
         return new PwError('login.not');
     }
     if (!$this->forum->isForum()) {
         return new PwError('FORUM_IS_NOT_EXISTS');
     }
     if (($result = $this->forum->allowUpload($this->user)) !== true) {
         return new PwError('BBS:forum.permissions.upload.allow', array('{grouptitle}' => $this->user->getGroupInfo('name')));
     }
     if (!$this->forum->foruminfo['allow_upload'] && !$this->user->getPermission('allow_upload')) {
         return new PwError('permission.upload.allow', array('{grouptitle}' => $this->user->getGroupInfo('name')));
     }
     if ($uploadPerday = $this->user->getPermission('uploads_perday')) {
         $count = PwUpload::countUploadedFile() + count($this->flashatt);
         $todayupload = $this->user->info['lastpost'] < Pw::getTdtime() ? 0 : $this->user->info['todayupload'];
         if ($count > 0 && $count + $todayupload > $uploadPerday) {
             return new PwError('permission.upload.nums.perday', array('{nums}' => $uploadPerday));
         }
     }
     return true;
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:26,代码来源:PwAttUpload.php

示例5: getOperateCount

 public function getOperateCount($uid, $operate)
 {
     if (isset($this->_num[$uid][$operate])) {
         return $this->_num[$uid][$operate];
     }
     isset($this->_ops[$uid]) || ($this->_ops[$uid] = Wekit::load('credit.PwCreditLog')->getOperate($uid));
     $ops = $this->_ops[$uid];
     if (isset($ops[$operate]) && $ops[$operate]['update_time'] > Pw::getTdtime()) {
         return $ops[$operate]['num'];
     }
     return 0;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:12,代码来源:PwCreditBo.php

示例6: checkTodayNum

 public function checkTodayNum($mobile)
 {
     $info = $this->_getDs()->getMobileVerify($mobile);
     $number = 1;
     $tdtime = Pw::getTdtime();
     if ($info) {
         $number = $info['number'];
         if ($info['create_time'] < $tdtime + 86400 && $info['create_time'] > $tdtime) {
             $number++;
         } else {
             $number = 1;
         }
     }
     if ($number > $this->sendNumDay) {
         return new PwError('USER:mobile.code.send.num.error');
     }
     return $number;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:18,代码来源:PwMobileService.php

示例7: _initVar

 private function _initVar()
 {
     $creditBo = PwCreditBo::getInstance();
     $sellCreditRange = $this->loginUser->getPermission('sell_credit_range', false, array());
     $allowThreadExtend = $this->loginUser->getPermission('allow_thread_extend', false, array());
     $sellConfig = array('ifopen' => $this->post->forum->forumset['allowsell'] && $allowThreadExtend['sell'] ? 1 : 0, 'price' => $sellCreditRange['maxprice'], 'income' => $sellCreditRange['maxincome'], 'credit' => Pw::subArray($creditBo->cType, $this->loginUser->getPermission('sell_credits')));
     !$sellConfig['credit'] && ($sellConfig['credit'] = array_slice($creditBo->cType, 0, 1, true));
     $enhideConfig = array('ifopen' => $this->post->forum->forumset['allowhide'] && $allowThreadExtend['hide'] ? 1 : 0, 'credit' => Pw::subArray($creditBo->cType, $this->loginUser->getPermission('enhide_credits')));
     !$enhideConfig['credit'] && ($enhideConfig['credit'] = array_slice($creditBo->cType, 0, 1, true));
     $allowUpload = $this->post->user->isExists() && $this->post->forum->allowUpload($this->post->user) && ($this->post->user->getPermission('allow_upload') || $this->post->forum->foruminfo['allow_upload']) ? 1 : 0;
     $attachnum = intval(Wekit::C('attachment', 'attachnum'));
     if ($perday = $this->post->user->getPermission('uploads_perday')) {
         $count = $this->post->user->info['lastpost'] < Pw::getTdtime() ? 0 : $this->post->user->info['todayupload'];
         $attachnum = max(min($attachnum, $perday - $count), 0);
     }
     $this->setOutput(PwSimpleHook::getInstance('PwEditor_app')->runWithFilters(array()), 'editor_app_config');
     $this->setOutput($this->post, 'pwpost');
     $this->setOutput($this->post->getDisabled(), 'needcheck');
     $this->setOutput($this->post->forum->fid, 'fid');
     $this->setOutput($this->post->forum, 'pwforum');
     $this->setOutput($sellConfig, 'sellConfig');
     $this->setOutput($enhideConfig, 'enhideConfig');
     $this->setOutput($allowThreadExtend, 'allowThreadExtend');
     $this->setOutput($allowUpload, 'allowUpload');
     $this->setOutput($attachnum, 'attachnum');
 }
开发者ID:YoursBoss,项目名称:nextwind,代码行数:26,代码来源:PostController.php

示例8: updateUser

 public function updateUser()
 {
     $userDm = $this->getUserDm();
     $userDm->setLastpost(Pw::getTime());
     if ($this->user->info['lastpost'] < Pw::getTdtime()) {
         $userDm->setTodaypost(0)->setTodayupload(0);
     }
     return $userDm;
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:9,代码来源:PwPostAction.php

示例9: run

 public function run()
 {
     $page = intval($this->getInput('page', 'get'));
     $page < 1 && ($page = 1);
     $perpage = 20;
     list($start, $limit) = Pw::page2limit($page, $perpage);
     $gid = $this->getInput('gid');
     $url = array();
     if ($gid) {
         $url['gid'] = $gid;
         $current = $gid;
         $user = Wekit::load('attention.PwAttentionType')->getUserByType($this->loginUser->uid, $gid, 2000);
         $uids = array_keys($user);
         $count = $this->_getService()->countAttentionFreshByUid($this->loginUser->uid, $uids);
         Wind::import('SRV:attention.srv.dataSource.PwFetchAttentionFreshByUid');
         $dataSource = new PwFetchAttentionFreshByUid($this->loginUser->uid, $uids, $limit, $start);
     } else {
         $current = 'all';
         $count = $this->_getService()->countAttentionFresh($this->loginUser->uid);
         if ($count > 200) {
             $count > 250 && Wekit::load('attention.PwFresh')->deleteAttentionFresh($this->loginUser->uid, $count - 200);
             $count = 200;
         }
         Wind::import('SRV:attention.srv.dataSource.PwFetchAttentionFresh');
         $dataSource = new PwFetchAttentionFresh($this->loginUser->uid, $limit, $start);
     }
     $freshDisplay = new PwFreshDisplay($dataSource);
     $fresh = $freshDisplay->gather();
     $type = Wekit::load('attention.srv.PwAttentionService')->getAllType($this->loginUser->uid);
     $unpost = '';
     !$this->loginUser->info['lastpost'] && ($this->loginUser->info['lastpost'] = $this->loginUser->info['regdate']);
     $tmp = Pw::getTime() - $this->loginUser->info['lastpost'];
     if ($tmp > 31536000) {
         $unpost = floor($tmp / 31536000) . '年多';
     } elseif ($tmp > 2592000) {
         $unpost = floor($tmp / 2592000) . '个多月';
     } elseif ($tmp > 172800) {
         $unpost = floor($tmp / 86400) . '天';
     }
     $type = Wekit::load('attention.srv.PwAttentionService')->getAllType($this->loginUser->uid);
     $allowUpload = $this->loginUser->getPermission('allow_upload');
     if ($imgextsize = Pw::subArray(Wekit::C('attachment', 'extsize'), array('jpg', 'jpeg', 'png', 'gif', 'bmp'))) {
         $maxSize = max($imgextsize) . ' KB';
         $filetypes = '*.' . implode(';*.', array_keys($imgextsize));
         $attachnum = intval(Wekit::C('attachment', 'attachnum'));
         if ($perday = $this->loginUser->getPermission('uploads_perday')) {
             $todayupload = $this->loginUser->info['lastpost'] < Pw::getTdtime() ? 0 : $this->loginUser->info['todayupload'];
             $attachnum = max(min($attachnum, $perday - $todayupload), 0);
             $attachnum == 0 && ($allowUpload = 0);
         }
     } else {
         $allowUpload = $attachnum = $maxSize = 0;
         $filetypes = '';
     }
     $this->setOutput($allowUpload, 'allowUpload');
     $this->setOutput($attachnum, 'attachnum');
     $this->setOutput($maxSize, 'maxSize');
     $this->setOutput($filetypes, 'filetypes');
     $this->setOutput($current, 'currents');
     $this->setOutput($type, 'type');
     $this->setOutput($unpost, 'unpost');
     $this->setOutput($fresh, 'freshdb');
     $this->setOutput($this->loginUser->getPermission('fresh_delete'), 'freshDelete');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($count, 'count');
     $this->setOutput($url, 'url');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:bbs.fresh.run.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:74,代码来源:FreshController.php


注:本文中的Pw::getTdtime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。