This commit is contained in:
2020-10-30 01:52:20 +08:00
parent 73a2f691ce
commit 0f900614ec
2 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -6,6 +6,7 @@
* Time: 14:39
*/
declare(strict_types=1);
namespace Database\Base;
@@ -664,7 +665,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
}
if (isset($this->_attributes[$name]) || array_key_exists($name, $this->_attributes)) {
return stripcslashes($this->_attributes[$name]);
return static::getColumns()->_decode($name, $this->_attributes[$name]);
}
if (isset($this->_relate[$name])) {
+13
View File
@@ -122,6 +122,19 @@ class Columns extends Component
}
}
/**
* @param $name
* @param $value
* @return float|int|mixed|string
* @throws Exception
*/
public function _decode(string $name, $value)
{
return $this->decode($value, $this->get_fields($name));
}
/**
* @param $val
* @param $format