Jelajahi Sumber

Update: 修复between and问题

zjh 3 bulan lalu
induk
melakukan
1a06b90e5e
2 mengubah file dengan 10 tambahan dan 0 penghapusan
  1. 7 0
      src/Base/Action.php
  2. 3 0
      src/Driver/Base.php

+ 7 - 0
src/Base/Action.php

@@ -9,6 +9,13 @@ class Action extends Controller
     public $controllerId;
     public $actionId;
     public $response;
+
+    public function __get($name) {
+        if (property_exists($this->controller, $name)) {
+            return $this->controller->$name;
+        }
+    }
+
     public function __call($method, $args)
     {
     	return call_user_func_array(array($this->controller, $method), $args);

+ 3 - 0
src/Driver/Base.php

@@ -1343,6 +1343,9 @@ class Base
                 if($opt != 'between') {
                     $val = $this->setQuote($val);
                 }
+                if($opt == 'between' && is_array($val)) {
+                    $val = "'". join("' AND '", $val) . "'";
+                }
                 $where[] = sprintf($operator[$opt], $alias, $name, $val);
             }
             $lastIsValue = $isValue;