本文整理汇总了PHP中Subjects::fetchAd方法的典型用法代码示例。如果您正苦于以下问题:PHP Subjects::fetchAd方法的具体用法?PHP Subjects::fetchAd怎么用?PHP Subjects::fetchAd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subjects
的用法示例。
在下文中一共展示了Subjects::fetchAd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render($args = NULL)
{
parent::render($args);
$this->template->database = $this->context->database;
$this->template->subjects = $this->subjects->fetchAd($this->strict);
$this->template->type = $this->type;
$this->template->setFile(__DIR__ . "/BannerSubjects.latte");
dibi::begin();
foreach ($this->subjects as $key => $value) {
dibi::query('update subject set ad_show_count=ad_show_count+1 where id=' . $key);
}
dibi::commit();
$this->template->render();
}
示例2: renderSubjects
public function renderSubjects($args = NULL)
{
dump($args);
if (key_exists('shire', $args)) {
$this->subjects->where('ad_shire', $args['shire']);
}
if (key_exists('locality', $args)) {
$this->subjects->where('ad_locality', $args['locality']);
}
if (key_exists('category', $args)) {
$this->subjects->where('ad_category', $args['category']);
}
$this->subjects->fetchAd($this->strict);
$this->template->setFile(dirname(__FILE__) . '/subjects.latte');
$this->render();
}
示例3: handleRecommended
public function handleRecommended()
{
$this->tab = 'recommended';
$this->subjects->fetchAd(null, true)->order('created DESC');
$this->refresh();
}