當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Campaign::where方法代碼示例

本文整理匯總了PHP中Campaign::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP Campaign::where方法的具體用法?PHP Campaign::where怎麽用?PHP Campaign::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Campaign的用法示例。


在下文中一共展示了Campaign::where方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update

 /**
  * Update the specified resource in storage.
  * PUT /campaigns/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $campaigns = Campaign::where('id', $id)->update(Input::all());
     if ($campaigns) {
         return ['status' => true, 'data' => $campaigns];
     } else {
         return ['status' => false];
     }
 }
開發者ID:sahilkathpal,項目名稱:hackcoin,代碼行數:16,代碼來源:CampaignsController.php

示例2: showDetails

 public function showDetails($id)
 {
     $category = Category::find($id);
     // If no item in database
     if (empty($category) || empty($category->id)) {
         return Redirect::route('home')->with('message', Lang::get('admin/categories.inexistant'));
     }
     $campaigns = Campaign::where('category_id', '=', $id)->get();
     $this->layout->content = View::make('public.categories.details');
     $this->layout->content->category = $category;
     $this->layout->content->campaigns = $campaigns;
     $this->layout->content_title = Lang::get('categories.details.title', array('category' => $category->title));
 }
開發者ID:ddcint,項目名稱:benefund,代碼行數:13,代碼來源:CategoriesController.php

示例3: index

 function index($name)
 {
     $a = new Account();
     if ($name != "") {
         $c = new Campaign();
         $c->where('nickname', $name)->get();
         if ($c->id > 0) {
             $data['campaign_id'] = $c->id;
             $data['name'] = $c->name;
             $data['description'] = $c->description;
             $data['photo'] = $c->photo;
             $data['countryid'] = $c->countryid;
             $data['categoryid'] = $c->categoryid;
             $data['isInfo'] = $c->isInfo;
             $data['title'] = $c->name;
             /*
              * get comments for the campaign
              */
             $com = new Comment();
             $com->where('campaign_id', $c->id)->get();
             //$comments = new ArrayObject();
             $commentsStr = "[";
             $flag = 0;
             foreach ($com->all as $comment) {
                 $usr = new Account();
                 $usr->where('id', $comment->user_id)->get();
                 $preCom = "<img src = '" . base_url() . "/images/profile/" . $usr->photo . "' align='left'><i>says </i>";
                 if ($flag) {
                     $commentsStr = $commentsStr . ",";
                 }
                 $flag = 1;
                 $commentsStr = $commentsStr . "\"" . $preCom . $comment->comment . "\"";
                 //$data['comments'][] = $comment->comment;
                 //$data['comments_uid'][] = $comment->user_id;
             }
             $commentsStr = $commentsStr . "]";
             $data['commentsStr'] = $commentsStr;
             $data['commentsNum'] = $com->count();
         }
     }
     $data['a'] = $a;
     $_SESSION['url'] = site_url('destination/index/' . $name);
     $this->load->view('destination', $data);
 }
開發者ID:parag,項目名稱:travelohic,代碼行數:44,代碼來源:destination.php

示例4: showManage

 public function showManage()
 {
     $campaigns = Campaign::where('item_vendor_id', Auth::user()->id);
     if (Input::get('s', '') != '') {
         $campaigns->where('title', 'LIKE', '%' . Input::get('s') . '%')->orWhere('description', 'LIKE', '%' . Input::get('s') . '%')->orWhere('item_title', 'LIKE', '%' . Input::get('s') . '%')->orWhere('item_description', 'LIKE', '%' . Input::get('s') . '%')->orWhere('target_title', 'LIKE', '%' . Input::get('s') . '%');
     }
     $campaigns->orderBy('id', 'desc');
     $this->layout->content = View::make('public.campaigns.manage');
     $this->layout->content->campaigns = $campaigns->get();
     $this->layout->content_title = Lang::get('campaigns.manage.title');
 }
開發者ID:ddcint,項目名稱:benefund,代碼行數:11,代碼來源:CampaignsController.php


注:本文中的Campaign::where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。