当前位置: 首页>>代码示例>>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;未经允许,请勿转载。