这是我的html页面,除默认情况(默认情况为按默认顺序排序的条件)外,其他所有内容均正常运行,请查看我的代码
html前端页面
这是我正在加载的html代码,但是当我使用where且其他排序方式无法正常工作时,我想使用默认排序方式。
<div class="row product-data">
<div class="row">
<!-- ajax content here -->
<!--<div class="list box text-shadow" style="margin: 30px 0 0;"></div>-->
<div class="list" style="margin: 30px 0 0;"></div>
</div>
现在这是我的服务器文件
受保护 函数getData(){
$items = null;
$query = "SELECT * FROM ".DB_TABLE.
" WHERE status=0";
if ($this - > filter - > filterQuery) {
$query. = " ".$this - > filter - > filterQuery.
" ";
}
//get queries / fields
if ($this - > sorting - > sortQuery) {
$query. = " ".$this - > sorting - > sortQuery.
" ";
}
//error_log(print_r($this->filter->filterQuery));
if ($this - > pagination - > paginationQuery) {
$query. = " ".$this - > pagination - > paginationQuery.
" ";
}
if (count($this - > filter - > preparedParams) > 0) {
$stmt = $this - > db - > prepare($query);
$stmt - > execute($this - > filter - > preparedParams);
$items = $stmt - > fetchAll();
} else {
$items = $this - > db - > query($query);
}
return $items;
}
请帮帮我