pmsRepository = $pmsRepository; } public function index() { $user = auth('web-company')->user(); $where['msgtouid'] = $user->id; $where['utype'] = $user->utype; //一个月前 $date = date('Y-m-d',strtotime('-1 month')); $pms = $this->pmsRepository->recentPms($where,$date); $list = []; foreach ($pms as $val) { $date = substr($val->created_at,0,10); $list[$date][] = $val; } return view('app.hardware.pad.message.index',['title'=>'我的消息','list'=>$list]); } public function delete(Request $request) { $id = explode(',',$request->id); $user = $this->getLoginUser(); if($this->pmsRepository->deleteAll($id,$user->id)){ return response()->json(['status'=>1, 'msg'=>'删除成功']); } return response()->json(['status'=>0, 'msg'=>'删除失败']); } }