mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
model类的_after_find 和 _after_select 回调调整
This commit is contained in:
@@ -507,6 +507,8 @@ class Model
|
|||||||
|
|
||||||
// 数据列表读取后的处理
|
// 数据列表读取后的处理
|
||||||
$resultSet = $this->_read_datalist($resultSet, $options);
|
$resultSet = $this->_read_datalist($resultSet, $options);
|
||||||
|
// 回调
|
||||||
|
$this->_after_select($resultSet, $options);
|
||||||
if (isset($options['index'])) {
|
if (isset($options['index'])) {
|
||||||
// 对数据集进行索引
|
// 对数据集进行索引
|
||||||
$index = explode(',', $options['index']);
|
$index = explode(',', $options['index']);
|
||||||
@@ -538,7 +540,6 @@ class Model
|
|||||||
protected function _read_datalist($resultSet, $options)
|
protected function _read_datalist($resultSet, $options)
|
||||||
{
|
{
|
||||||
$resultSet = array_map([$this, '_read_data'], $resultSet);
|
$resultSet = array_map([$this, '_read_data'], $resultSet);
|
||||||
$this->_after_select($resultSet, $options);
|
|
||||||
return $resultSet;
|
return $resultSet;
|
||||||
}
|
}
|
||||||
// 查询成功后的回调方法
|
// 查询成功后的回调方法
|
||||||
@@ -879,6 +880,8 @@ class Model
|
|||||||
$data = $this->_read_data($resultSet[0], $options);
|
$data = $this->_read_data($resultSet[0], $options);
|
||||||
// 数据对象赋值
|
// 数据对象赋值
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
|
// 回调
|
||||||
|
$this->_after_find($data, $options);
|
||||||
if (isset($cache)) {
|
if (isset($cache)) {
|
||||||
Cache::set($key, $data, $cache['expire']);
|
Cache::set($key, $data, $cache['expire']);
|
||||||
}
|
}
|
||||||
@@ -902,7 +905,6 @@ class Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->_after_find($data, $options);
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
// 数据读取成功后的回调方法
|
// 数据读取成功后的回调方法
|
||||||
|
|||||||
Reference in New Issue
Block a user