orderBy('sort', 'desc'); if (!empty($where) && is_array($where)) { $data = $data->where($where); } $data = $data->paginate($list); if (!$data) { return -4010010022; //没有数据 } return $data->toArray(); } public function getLotteryList(){ $data = $this->orderBy('sort', 'desc')->get(); if (!$data) { return -4010010022; //没有数据 } return $data->toArray(); } public function gLotteryList($type){ $data = $this->select('type')->where('type',$type)->first(); if (!$data) { return -4010010022; //没有数据 } return $data->toArray(); } }