當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。