本文整理汇总了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];
}
}
示例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));
}
示例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);
}
示例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');
}