本文整理匯總了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));
}