本文整理匯總了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);
}
示例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;
}
示例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);
}
示例4: _getDao
/**
* Enter description here ...
* @return PwSpecialSortDao
*/
protected function _getDao()
{
return Wekit::loadDao('forum.dao.PwSpecialSortDao');
}
示例5: _getBlacklistDao
/**
* @return WindidUserBlackDao
*/
protected function _getBlacklistDao()
{
return Wekit::loadDao('WSRV:user.dao.WindidUserBlackDao');
}
示例6: _loadDao
/**
* @return App_Account_InfoDao
*/
private function _loadDao()
{
return Wekit::loadDao('EXT:account.service.dao.App_Account_TaobaoUserInfoDao');
}
示例7: _getDao
/**
* 獲得用戶禁止DAO
*
* @return PwUserBanDao
*/
private function _getDao()
{
return Wekit::loadDao('user.dao.PwUserBanDao');
}
示例8: _getDao
private function _getDao()
{
return Wekit::loadDao('native.dao.PwBannerDao');
}
示例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";
}
示例10: _dao
/**
* @return PwPatchDao
*/
private function _dao()
{
return Wekit::loadDao('patch.dao.PwPatchDao');
}
示例11: _getRemindDao
/**
* @return PwRemindDao
*/
protected function _getRemindDao()
{
return Wekit::loadDao('remind.dao.PwRemindDao');
}
示例12: _getDao
protected function _getDao()
{
return Wekit::loadDao('forum.dao.PwPostsReplyDao');
}
示例13: loadDao
/**
* @return App_Image_Dao
*/
private function loadDao()
{
return Wekit::loadDao('EXT:4tschool.service.searches.dao.App_Search_Dao');
}
示例14: _getLikeRelationsDao
private function _getLikeRelationsDao()
{
return Wekit::loadDao('like.dao.PwLikeRelationsDao');
}
示例15: getApp_NANATools_AdminRole
private function getApp_NANATools_AdminRole()
{
return Wekit::loadDao('EXT:nanatools.service.dao.App_NANATools_AdminRoleDao');
}