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