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