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


PHP Wekit::loadDao方法代码示例

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


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

示例1: __construct

 public function __construct($forum)
 {
     $this->forum = $forum;
     $this->specialSortTids = array_keys(Wekit::loadDao('native.dao.PwNativeSpecialSortDao')->getSpecialSortByTopId($forum->fid, 1));
     //                var_dump($this->specialSortTids);exit;
     $this->count = count($this->specialSortTids);
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:7,代码来源:PwNativeCommonThread.php

示例2: getBaseInstance

 /**
  * 获取当前dao类的基础DAO类
  * 
  * 获取当前dao类的基础DAO类,当baseInstance没有设置时,调用defaultBaseInstance
  * @throws Exception
  * @return PwBaseDao
  */
 public function getBaseInstance()
 {
     if (!$this->_baseInstance) {
         if (empty($this->_defaultBaseInstance)) {
             throw new Exception('This dao is error');
         }
         $this->_baseInstance = Wekit::loadDao($this->_defaultBaseInstance);
     }
     return $this->_baseInstance;
 }
开发者ID:YoursBoss,项目名称:nextwind,代码行数:17,代码来源:PwBaseDao.php

示例3: run

 /**
 * 查看未读系统通知列表,并将已查看的未读消息设为已读
 * @access public
 * @return string
  <pre>
  /index.php?m=native&c=notice&type=(reply|system)&page=1&_json=1
  type:10 未读通知;0 所有系统消息
  response: html
  </pre>
 */
 public function run()
 {
     list($type, $page) = $this->getInput(array('type', 'page'));
     //                $type = 3;
     if ($type == 'reply') {
         $typeids = array(10);
         //回复提醒
         $exclude = false;
     } else {
         $typeids = array(1, 10);
         //排除私信提醒、回复提醒
         $exclude = true;
     }
     $page = intval($page);
     $page < 1 && ($page = 1);
     $perpage = 20;
     list($start, $limit) = Pw::page2limit($page, $perpage);
     $notice_list = Wekit::loadDao('native.dao.PwNativeMessageNoticesDao')->getNoticesByTypeIds($this->uid, $typeids, $start, $limit, $exclude);
     $notice_list = $this->_getNoticeService()->formatNoticeList($notice_list);
     //                $noticeList = $this->_getNoticeDs()->getNotices($this->loginUser->uid,$type,$start, $limit);
     //		$noticeList = $this->_getNoticeService()->formatNoticeList($noticeList);
     //                var_dump($noticeList);exit;
     $typeCounts = $this->_getNoticeService()->countNoticesByType($this->uid);
     //获取用户通知总数
     //类型
     $typeid = intval($type);
     //获取所有NOTICE未读通知数
     $unreadCount = $this->_getNoticeDs()->getUnreadNoticeCount($this->uid);
     //                $unread_notice_cnt = Wekit::loadDao('native.dao.PwNativeMessageNoticesDao')->getUnreadCountByTypeIds($this->loginUser->uid,$typeids,$exclude);
     //		$this->_readNoticeList($unreadCount,$noticeList);//将消息设置为已读
     $this->_readNoticeList($unreadCount, $notice_list);
     //将消息设置为已读
     var_dump($notice_list, $unreadCount);
     exit;
     //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:chendong0444,项目名称:phpwind,代码行数:61,代码来源:NoticeController.php

示例4: _getDao

 /**
  * Enter description here ...
  * @return PwSpecialSortDao
  */
 protected function _getDao()
 {
     return Wekit::loadDao('forum.dao.PwSpecialSortDao');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:8,代码来源:PwSpecialSort.php

示例5: _getBlacklistDao

 /**
  * @return WindidUserBlackDao
  */
 protected function _getBlacklistDao()
 {
     return Wekit::loadDao('WSRV:user.dao.WindidUserBlackDao');
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:7,代码来源:WindidUserBlack.php

示例6: _loadDao

 /**
  * @return App_Account_InfoDao
  */
 private function _loadDao()
 {
     return Wekit::loadDao('EXT:account.service.dao.App_Account_TaobaoUserInfoDao');
 }
开发者ID:sanzhumu,项目名称:nextwind,代码行数:7,代码来源:App_Account_TaobaoUserInfo.php

示例7: _getDao

 /** 
  * 获得用户禁止DAO
  *
  * @return PwUserBanDao
  */
 private function _getDao()
 {
     return Wekit::loadDao('user.dao.PwUserBanDao');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:9,代码来源:PwUserBan.php

示例8: _getDao

 private function _getDao()
 {
     return Wekit::loadDao('native.dao.PwBannerDao');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:4,代码来源:BannerController.php

示例9: weightCron

 public function weightCron()
 {
     $threadsWeightDao = Wekit::loadDao('native.dao.PwThreadsWeightDao');
     //执行权重计算逻辑
     $current_time = time();
     $stop_time = $current_time - 604800;
     //获取7天前的数据进行计算
     $threadsWeightDao->deleteAutoData();
     //删除自动生成热帖数据
     $threadsWeightDao->deleteUserData($stop_time);
     //删除推荐的过期热帖数据
     //            $stop_time = $current_time-1604800;//获取更早前的数据
     //            echo $stop_time;exit;
     $nativeThreadsDao = Wekit::loadDao('native.dao.PwNativeThreadsDao');
     //从论坛帖子列表获取指定时间内的帖子条数
     $res = $nativeThreadsDao->getCountByTime($stop_time);
     $threads_count = intval($res['count']);
     $threads_count = $threads_count > 1000 ? 1000 : $threads_count;
     //权重计算默认只取1000条
     $num = 50;
     //一次处理的记录数
     $pages = ceil($threads_count / $num);
     //计算热帖的自然权重值,并将结果插入权重表
     for ($i = 1; $i <= $pages; $i++) {
         //                $starttime_test = time();
         $page = $i;
         $start = ($page - 1) * $num;
         //开始位置偏移
         $res = $nativeThreadsDao->fetchThreadsData($stop_time, $start, $num);
         $weight_values = array();
         if ($res) {
             foreach ($res as $k => $v) {
                 $weight = $v['like_count'] * 2 + $v['replies'] * 4 + $v['reply_like_count'] + floor(($current_time - $v['lastpost_time']) / 86400) * -4 + floor(($current_time - $v['created_time']) / 86400) * -20;
                 //                        $res[$k]['weight'] = $weight;
                 $weight_values[] = "({$v['tid']},{$weight},{$current_time},1)";
             }
             $weight_values = implode(',', $weight_values);
             //将权重计算结果插入权重表,表中已有数据不再重复插入
             $threadsWeightDao->insertValues($weight_values);
         }
     }
     //获取权重表中管理员设置的热帖数量
     $threads_count = $threadsWeightDao->getUserDataCount();
     $threads_count = isset($threads_count['count']) ? intval($threads_count['count']) : 0;
     $pages = ceil($threads_count / $num);
     //将管理员设置的热帖进行自然权重计算并更新数据
     for ($i = 1; $i <= $pages; $i++) {
         //                $starttime_test = time();
         $page = $i;
         $start = ($page - 1) * $num;
         //开始位置偏移
         $res = $threadsWeightDao->fetchUserThreadsData($start, $num);
         //获取管理员设置的热帖数据计算权重
         $weight_values = array();
         if ($res) {
             foreach ($res as $k => $v) {
                 $weight = $v['like_count'] * 2 + $v['replies'] * 4 + $v['reply_like_count'] + floor(($current_time - $v['lastpost_time']) / 86400) * -4 + floor(($current_time - $v['create_time']) / 86400) * -20;
                 $weight_values[] = "({$v['tid']},{$weight},{$v['create_time']},{$v['create_userid']},'{$v['create_username']}',{$v['isenable']})";
             }
             $weight_values = implode(',', $weight_values);
             //将权重计算结果覆盖插入权重表,表中已有数据将被覆盖
             $threadsWeightDao->replaceValues($weight_values);
         }
     }
     //对推荐不到2小时的数据继续置顶
     $max_weight = $threadsWeightDao->getMaxWeight();
     $max_weight = isset($max_weight['weight']) ? intval($max_weight['weight']) + 1 : 1;
     $threadsWeightDao->batchUpdateUserWeight($current_time - 7200, $max_weight);
     //只保留100条非用户推荐的自然计算数据
     $res = $threadsWeightDao->getWeightByPos(99);
     if ($res) {
         $weight = $res['weight'];
         $threadsWeightDao->deleteByWeight($weight);
     }
     //        echo "SCRIPT EXCUTE FINISHED";
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:76,代码来源:PwDynamicService.php

示例10: _dao

 /**
  * @return PwPatchDao
  */
 private function _dao()
 {
     return Wekit::loadDao('patch.dao.PwPatchDao');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:7,代码来源:PwPatch.php

示例11: _getRemindDao

 /**
  * @return PwRemindDao
  */
 protected function _getRemindDao()
 {
     return Wekit::loadDao('remind.dao.PwRemindDao');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:7,代码来源:PwRemind.php

示例12: _getDao

 protected function _getDao()
 {
     return Wekit::loadDao('forum.dao.PwPostsReplyDao');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:4,代码来源:PwPostsReply.php

示例13: loadDao

 /**
  * @return App_Image_Dao
  */
 private function loadDao()
 {
     return Wekit::loadDao('EXT:4tschool.service.searches.dao.App_Search_Dao');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:7,代码来源:App_Image.php

示例14: _getLikeRelationsDao

 private function _getLikeRelationsDao()
 {
     return Wekit::loadDao('like.dao.PwLikeRelationsDao');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:4,代码来源:PwLikeRelations.php

示例15: getApp_NANATools_AdminRole

 private function getApp_NANATools_AdminRole()
 {
     return Wekit::loadDao('EXT:nanatools.service.dao.App_NANATools_AdminRoleDao');
 }
开发者ID:taita2015,项目名称:NanaGate-2015,代码行数:4,代码来源:AdminController.php


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