mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进getData方法支持获取某个字段值
This commit is contained in:
@@ -163,11 +163,12 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
/**
|
/**
|
||||||
* 获取对象原始数据
|
* 获取对象原始数据
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $name 字段名 留空获取全部
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getData()
|
public function getData($name = '')
|
||||||
{
|
{
|
||||||
return $this->data;
|
return isset($this->data[$name]) ? $this->data[$name] : $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user