Browse Source

优化Selectpage的实现方法

PPPSCN 6 years ago
parent
commit
43d9883e7d
1 changed files with 7 additions and 3 deletions
  1. 7 3
      application/common/controller/Backend.php

+ 7 - 3
application/common/controller/Backend.php

@@ -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);
+                        }
                     }
                     }
                 }
                 }
             };
             };