本文整理匯總了PHP中Participant::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Participant::all方法的具體用法?PHP Participant::all怎麽用?PHP Participant::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Participant
的用法示例。
在下文中一共展示了Participant::all方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: profile
/**
* @before _secure
*/
public function profile()
{
$this->seo(array("title" => "Profile", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$participants = Participant::all(array("user_id = ?" => $this->user->id), array("campaign_id", "id", "created"));
$view->set("participants", $participants);
}
示例2: play
/**
* @before _secure
*/
public function play()
{
$this->seo(array("title" => "Play Game", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$session = Registry::get("session");
$campaign = $session->get('Game\\Authorize:$campaign');
if (!$campaign) {
$this->redirect("/index.html");
}
$session->erase('Game\\Authorize:$campaign');
$model = $campaign->type;
$game = $model::first(array("id = ?" => $campaign->type_id));
switch ($model) {
case 'imagetext':
$img = $this->_imagetextprocess($game, $campaign);
break;
case 'image':
$img = $this->_imageprocess($game, $campaign);
break;
case 'text':
$img = $this->_textprocess($game, $campaign);
break;
case 'shuffle':
$img = $this->_shuffleprocess($game, $campaign);
break;
}
$participant = Participant::first(array("user_id = ?" => $this->user->id, "campaign_id = ?" => $campaign->id));
$facebook = new Curl();
$facebook->post('https://graph.facebook.com/?id=' . "http://" . $_SERVER["HTTP_HOST"] . "/game/result/" . $participant->id . '&scrape=true');
$facebook->close();
$domain = Meta::first(array("property = ?" => "domain", "live = ?" => true));
$items = Participant::all(array(), array("DISTINCT campaign_id"), "created", "desc", 3, 1);
$view->set("items", $items);
$view->set("img", $img);
$view->set("participant", $participant);
$view->set("campaign", $campaign)->set("domain", $domain);
}