本文整理汇总了PHP中Reply::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Reply::findAll方法的具体用法?PHP Reply::findAll怎么用?PHP Reply::findAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reply
的用法示例。
在下文中一共展示了Reply::findAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$controller = $this->getController();
$controller->_seoTitle = Yii::t('common', 'User Center') . ' - ' . Yii::t('common', 'My Replys') . ' - ' . $controller->_setting['site_name'];
//我的回复
$uid = Yii::app()->user->id;
$comment_mod = new Comment();
$reply_mod = new Reply();
$criteria = new CDbCriteria();
$criteria->addColumnCondition(array('t.user_id' => $uid));
$criteria->order = 't.id DESC';
//分页
$count = $reply_mod->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 15;
$pages->applyLimit($criteria);
$datalist = $reply_mod->findAll($criteria);
foreach ((array) $datalist as $k => $v) {
$reply = $comment_mod->findByPk($v->cid);
if ($reply) {
$c_mod_class = $controller->_content_models[$reply->type];
$c_mod_name = strtolower($c_mod_class);
$content_mod = new $c_mod_class();
$content = $content_mod->findByPk($reply->content_id);
$datalist[$k]['title'] = $content->title;
$datalist[$k]['url'] = $controller->createUrl($c_mod_name . '/view', array('id' => $reply->content_id));
}
}
$controller->render('my_replys', array('datalist' => $datalist, 'pages' => $pages));
}
示例2: actionIndex
/**
* 回复管理
*
*/
public function actionIndex()
{
$model = new Reply();
$criteria = new CDbCriteria();
$condition = '1';
$status = $this->_request->getParam('status');
$status && ($condition .= " AND t.status='{$status}'");
$criteria->condition = $condition;
$criteria->order = 't.id DESC';
$count = $model->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 15;
$pageParams = $this->buildCondition($_GET, array('status'));
$pages->params = is_array($pageParams) ? $pageParams : array();
$criteria->limit = $pages->pageSize;
$criteria->offset = $pages->currentPage * $pages->pageSize;
$result = $model->findAll($criteria);
Yii::app()->clientScript->registerCssFile($this->_static_public . "/js/kindeditor/code/prettify.css");
Yii::app()->clientScript->registerScriptFile($this->_static_public . "/js/kindeditor/code/prettify.js", CClientScript::POS_END);
$this->render('index', array('datalist' => $result, 'pagebar' => $pages));
}
示例3: run
public function run()
{
$model = new Reply();
//条件
$criteria = new CDbCriteria();
$status = trim(Yii::app()->request->getParam('status'));
$status && $criteria->addColumnCondition(array('status' => $status));
$title = trim(Yii::app()->request->getParam('content'));
$title && $criteria->addSearchCondition('content', $title);
$criteria->order = 't.id DESC';
$count = $model->count($criteria);
//分页
$pages = new CPagination($count);
$pages->pageSize = 10;
$pages->applyLimit($criteria);
//查询
$result = $model->findAll($criteria);
Yii::app()->clientScript->registerCssFile($this->controller->_static_public . "/js/kindeditor/code/prettify.css");
Yii::app()->clientScript->registerScriptFile($this->controller->_static_public . "/js/kindeditor/code/prettify.js", CClientScript::POS_END);
$this->controller->render('index', array('model' => $model, 'datalist' => $result, 'pagebar' => $pages));
}
示例4: run
public function run()
{
$controller = $this->getController();
$this->_setting = $controller->_setting;
$this->_stylePath = $controller->_stylePath;
$this->_static_public = $controller->_static_public;
$controller->_seoTitle = Yii::t('common', 'User Center') . ' - ' . Yii::t('common', 'My Replys') . ' - ' . $this->_setting['site_name'];
//加载css,js
Yii::app()->clientScript->registerCssFile($this->_stylePath . "/css/user.css");
Yii::app()->clientScript->registerScriptFile($this->_static_public . "/js/jquery/jquery.js");
//我的回复
$uid = Yii::app()->user->id;
$comment_mod = new Comment();
$reply_mod = new Reply();
$model_type = new ModelType();
$uid = Yii::app()->user->id;
$criteria = new CDbCriteria();
$criteria->condition = 't.user_id=' . $uid;
$criteria->order = 't.id DESC';
//分页
$count = $reply_mod->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 15;
$criteria->limit = $pages->pageSize;
$criteria->offset = $pages->currentPage * $pages->pageSize;
$datalist = $reply_mod->findAll($criteria);
foreach ((array) $datalist as $k => $v) {
$reply = $comment_mod->findByPk($v->cid);
if ($reply) {
$c_mod_class = $controller->_content_models[$reply->type];
$c_mod_name = strtolower($c_mod_class);
$content_mod = new $c_mod_class();
$content = $content_mod->findByPk($reply->topic_id);
$datalist[$k]['title'] = $content->title;
$datalist[$k]['url'] = $controller->createUrl($c_mod_name . '/view', array('id' => $reply->topic_id));
}
}
$controller->render('my_replys', array('datalist' => $datalist));
}