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


PHP Message::whereIn方法代碼示例

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


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

示例1: mutilDestroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  MessageRequest $request
  * @return Response
  */
 public function mutilDestroy(MessageRequest $request)
 {
     Message::whereIn('id', $request->input('checkbox'))->delete();
     return new JsonResponse(['message' => Lang::get('message.destroy')], 200);
 }
開發者ID:khanhpnk,項目名稱:sbds,代碼行數:11,代碼來源:MessageController.php

示例2: getShortDescription

 public function getShortDescription(Request $request)
 {
     //fetching all the receipient ids
     $userId = Auth::user()->email;
     $message = MessageReceipient::where('receipient_ID', $userId)->get();
     $metaIds = array();
     //fetching meta ids and storing in the array
     foreach ($message as $key => $value) {
         $metaIds[] = $value['meta_Id'];
     }
     //getting all the message corresponding to a user
     $message = Message::whereIn('meta_Id', $metaIds)->groupBy('from')->get();
     foreach ($message as $key => $value) {
         //fetching user id on the basis of email
         $email = $value['from'];
         $userName = User::where('email', $email)->pluck('id');
         //converting time into epoch value
         $epoch = strtotime($value['created_at']);
         $value['epoch'] = $epoch;
         //user name on the basis of email
         if ($value['from'] == $userId) {
             //if message is sending by logged in user set "me"
             $value['from'] = "Me";
         } else {
             //if message is sending by other email address then set user name instead of email id
             $value['from'] = UserDetail::where('userid', $userName)->pluck('name');
         }
         //getting user profile picture path
         $profilePic = UserDetail::where('userid', $userName)->pluck('profilePicPath');
         $value['path'] = $profilePic;
     }
     return $message;
 }
開發者ID:shrastisoni,項目名稱:bul1,代碼行數:33,代碼來源:MessageController.php


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