insert($data); } public function updateSystemRed($where,$data) { return $this->where($where)->update($data); } public function getSystemRedOne($where) { return $this->where($where)->first(); } function getAll() { if(empty($list)) { $list = 10; } $data = DB::table('system_red AS sr') ->select('sr.id','sr.red_num','sr.red_money','sr.status','sr.username','cr.room_name') ->leftJoin('chat_rooms AS cr','sr.room_id','=','cr.id') ->orderBy('sr.id','desc') ->paginate($list); if(!$data){ return -5040000522;//没有数据 } return $data->toArray(); } public function checkRoom($room_id) { return $this->where("room_id",$room_id)->first(); } }