优化Selectpage的实现方法

pull/98/MERGE
PPPSCN 2019-02-17 15:25:51 +08:00 committed by Karson
parent 0f1ce99a25
commit 43d9883e7d
1 changed files with 7 additions and 3 deletions

View File

@ -295,7 +295,7 @@ class Backend extends Controller
$sym = strtoupper(isset($op[$k]) ? $op[$k] : $sym); $sym = strtoupper(isset($op[$k]) ? $op[$k] : $sym);
switch ($sym) { switch ($sym) {
case '=': case '=':
case '!=': case '<>':
$where[] = [$k, $sym, (string)$v]; $where[] = [$k, $sym, (string)$v];
break; break;
case 'LIKE': case 'LIKE':
@ -433,7 +433,7 @@ class Backend extends Controller
//是否返回树形结构 //是否返回树形结构
$istree = $this->request->request("isTree", 0); $istree = $this->request->request("isTree", 0);
$ishtml = $this->request->request("isHtml", 0); $ishtml = $this->request->request("isHtml", 0);
if($istree) { if ($istree) {
$word = []; $word = [];
$pagesize = 99999; $pagesize = 99999;
} }
@ -455,7 +455,11 @@ class Backend extends Controller
} }
if ($custom && is_array($custom)) { if ($custom && is_array($custom)) {
foreach ($custom as $k => $v) { foreach ($custom as $k => $v) {
$query->where($k, '=', $v); if (is_array($v) && 2 == count($v)) {
$query->where($k, trim($v[0]), $v[1]);
} else {
$query->where($k, '=', $v);
}
} }
} }
}; };