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


PHP Picture::where方法代码示例

本文整理汇总了PHP中Picture::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Picture::where方法的具体用法?PHP Picture::where怎么用?PHP Picture::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Picture的用法示例。


在下文中一共展示了Picture::where方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gallary

 public function gallary()
 {
     $album_id = Input::get("album_id");
     $user_id = Input::get("user_id");
     $photos = Picture::where("album_id", "=", $album_id)->get();
     return View::make('userCenter.gallary')->with(array("photos" => $photos, "user_id" => $user_id, "album_id" => $album_id));
 }
开发者ID:Jv-Juven,项目名称:opera-1,代码行数:7,代码来源:UserPageController.php

示例2: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     // $user = User::findOrFail($id);
     $ued = Sentry::getUser()->id;
     $user = $this->user->find($id);
     //$products =  DB::table('products')->where('user_id',$ued)->get();
     $products = Product::where('user_id', $ued)->paginate(10);
     //$picture = DB::table('pictures')->where('user_id',$ued)->find(1);
     $image = Picture::where('user_id', $ued)->orderBy('id', 'desc')->get()->take(1);
     // $images = $user->pictures->find(1);
     return View::make('protected.standardUser.edit')->withUser($user)->with('products', $products)->with('image', $image);
 }
开发者ID:ArbindJain,项目名称:scrapkart,代码行数:18,代码来源:UsersController.php

示例3: getView

 public function getView($id)
 {
     $album = Album::where('id', '=', $id)->first();
     $pictures = Picture::where('album_id', '=', $id)->orderBy('votes', 'desc')->paginate(12);
     // layouts variables
     $this->layout->title = $album->name . ' | Нещо Шантаво';
     $this->layout->canonical = 'https://neshto.shantavo.com/album/' . $id;
     $this->layout->robots = 'index,follow,noodp,noydir';
     $this->layout->description = 'Това е албум';
     $this->layout->keywords = 'начало, нещо шантаво, team navy pier';
     // nesting the view into the layout
     $this->layout->nest('content', 'album.view', array('album' => $album, 'pictures' => $pictures));
 }
开发者ID:straho99,项目名称:NeshtoShantavo,代码行数:13,代码来源:AlbumController.php

示例4: postVote

 public function postVote()
 {
     $isVoted = false;
     $picture = Picture::where('id', '=', Input::get('id'))->first();
     if (Auth::check()) {
         foreach ($picture->voted as $vote) {
             if ($vote->user->id == Auth::user()->id) {
                 $isVoted = true;
             }
         }
         if (!$isVoted) {
             Picture::where('id', '=', Input::get('id'))->increment('votes', 1);
             Vote::insert(array('picture_id' => $picture->id, 'user_id' => Auth::user()->id));
             $picture = Picture::where('id', '=', Input::get('id'))->first();
             return intval($picture->votes);
         }
     }
     return false;
 }
开发者ID:straho99,项目名称:NeshtoShantavo,代码行数:19,代码来源:PictureController.php

示例5: getByRefId

 public static function getByRefId($refId, $type)
 {
     $images = Picture::where('ref_id', $refId)->where('image_type', $type)->get();
     return $images;
 }
开发者ID:EricBui0512,项目名称:FYP,代码行数:5,代码来源:Picture.php

示例6: deleteUpload

 /**
  * Action: Delete resource images
  * @param  int $id post ID
  * @return response
  */
 public function deleteUpload($id)
 {
     // Allow only pictures of the current article being deleted
     $filename = Picture::where('id', $id)->where('user_id', Auth::user()->id)->first();
     $oldImage = $filename->filename;
     if (is_null($filename)) {
         return Redirect::back()->with('error', '没有找到对应的图片');
     } elseif ($filename->delete()) {
         // Delete images
         File::delete(public_path('uploads/articles/' . $oldImage));
         return Redirect::back()->with('success', '图片删除成功。');
     } else {
         return Redirect::back()->with('warning', '图片删除失败。');
     }
 }
开发者ID:rimshavbase,项目名称:timefragment,代码行数:20,代码来源:ArticleResource.php


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