本文整理汇总了PHP中Articles::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Articles::select方法的具体用法?PHP Articles::select怎么用?PHP Articles::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articles
的用法示例。
在下文中一共展示了Articles::select方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findArticles
function findArticles($select = null)
{
$t = new Articles();
if (is_string($select)) {
$select = $t->select()->where($select);
}
$select->setIntegrityCheck(false)->from('article')->where('article.journal = ?', $this->id);
return $t->fetchAll($select);
}
示例2: actionModify
/**
* 添加、修改文章
*/
public function actionModify($id)
{
$id = (int) $id;
$where = array('a.aid' => $id);
$Articles = new Articles();
$Category = new Category();
$this->data = $Articles->select('c.*,a.*')->from('articles a')->join('articles_content c', 'a.aid=c.aid')->where($where)->getOne();
$this->data['content'] = stripslashes($this->data['content']);
$this->category = $Category->getAll();
}
示例3: actionArticle
/**
* 文章详情
*/
public function actionArticle($aid)
{
$aid = (int) $aid;
$Articles = new Articles();
$Category = new Category();
$where = array('a.aid' => $aid);
$this->data = $Articles->select('c.*,a.*')->from('articles a')->join('articles_content c', 'a.aid=c.aid')->where($where)->getOne();
$this->data['content'] = stripslashes($this->data['content']);
$this->title = $this->data['title'];
$this->category = $Category->getOne('*', array('cid' => $this->data['cid']));
$this->cid = $this->data['cid'];
}
示例4: findArticles
function findArticles()
{
$t = new Articles();
$s = $t->select()->setIntegrityCheck(false)->distinct()->from('article')->join('commentaire', 'commentaire.id = article.commentaires', array())->where('commentaire.auteur = ?', intval($this->id));
return $t->fetchAll($s);
}
示例5: actionIndex
/**
* 默认函数
*/
public function actionIndex()
{
$Articles = new Articles();
$this->list = $Articles->select('a.aid,a.title,a.add_date,c.c_name')->from('articles a')->join('category c', 'a.cid=c.cid')->limit(0, 12)->order('a.aid', 'desc')->getAll();
}