如何在Laravel中获取Mysql_result
public function getList($queryParams = [])
{
$result = new \App\BaseModel();
$modelClass = $this->modelClass;
$query = $this->getQuery($queryParams);
$sqlResult = $this->query();
dump($query);
$sqlResult =DB::select($query); //here I receive an array But I need to receive mysql_result
if($sqlResult) {
while($row = mysqli_fetch_assoc($sqlResult)) {
$result[$row[$this->listKey]] = new $modelClass($row);
}
}
if($this->calcFoundRows) {
$this->foundRows = (int) array_shift(mysql_fetch_row($this->query('SELECT FOUND_ROWS()')));
}
dd($result);
return $result;
}
我有例外 mysqli_fetch_assoc()期望参数1为mysqli_result,对象为