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


PHP Reply::where方法代碼示例

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


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

示例1: replydelete

 public function replydelete()
 {
     $id = Input::get('id');
     $reply_id = Input::get('reply_id');
     $data = Reply::where('id', '=', $id)->where('itemId', '=', $reply_id)->delete();
     return Redirect::to('seven');
 }
開發者ID:aelda,項目名稱:MessageBoard,代碼行數:7,代碼來源:HomeController.php

示例2: destroy

 public function destroy($id)
 {
     $topic = Topic::findOrFail($id);
     $this->authorOrAdminPermissioinRequire($topic->user_id);
     //刪除文章
     $topic->delete();
     //該文章相關的通知刪除
     Notification::where('user_id', '=', $topic->user_id)->where('topic_id', '=', $topic->id)->delete();
     //該文章的回複刪除
     Reply::where('topic_id', '=', $topic->id)->delete();
     Flash::success(lang('Operation succeeded.'));
     $url = Request::getRequestUri();
     if (stripos($url, 'account') == false) {
         return Redirect::route('topics.index');
     } else {
         return Redirect::route('ac_topices');
     }
 }
開發者ID:fcode520,項目名稱:phphub,代碼行數:18,代碼來源:TopicsController.php

示例3: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $chat = Chat::find($id);
     if (!isset($chat)) {
         return Redirect::to('/community/chats')->with('flash_chat', 'That chat doesn\'t exist!')->with('alert_class', 'alert-danger');
     }
     $users = $chat->user->all();
     //If the user isn't part of the conversation, don't let them view it
     $inArray = false;
     foreach ($users as $user) {
         if ($user->id == Auth::user()->id) {
             $inArray = true;
         }
     }
     if (!$inArray) {
         return Redirect::to('/community/chats')->with('flash_chat', 'You don\'t have permission to view this chat')->with('alert_class', 'alert-danger');
     }
     $replies = Reply::where('chat_id', '=', $chat->id)->get();
     foreach ($replies as $reply) {
         $notification = Notification::where('user_id', '=', Auth::user()->id)->where('reply_id', '=', $reply->id)->firstOrFail();
         $notification->has_read = 1;
         $notification->save();
     }
     return View::make('readOneChat')->with(array('chat' => $chat, 'users' => $chat->getOtherUsers(), 'replies' => $replies));
 }
開發者ID:alisha,項目名稱:seed,代碼行數:31,代碼來源:ChatController.php


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