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