当前位置: 首页>>代码示例>>PHP>>正文


PHP Participant::all方法代码示例

本文整理汇总了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);
 }
开发者ID:SwiftDeal,项目名称:fbfunapp,代码行数:10,代码来源:home.php

示例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);
 }
开发者ID:SwiftDeal,项目名称:fbfunapp,代码行数:40,代码来源:game.php


注:本文中的Participant::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。