mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
Query类的hidden和visible方法取消 改进Model类的hidden和visible方法支持操作关联属性
This commit is contained in:
@@ -1503,30 +1503,6 @@ class Query
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模型输出显示字段
|
||||
* @access public
|
||||
* @param mixed $visible
|
||||
* @return $this
|
||||
*/
|
||||
public function visible($visible)
|
||||
{
|
||||
$this->options['visible'] = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模型输出隐藏字段
|
||||
* @access public
|
||||
* @param mixed $hidden
|
||||
* @return $this
|
||||
*/
|
||||
public function hidden($hidden)
|
||||
{
|
||||
$this->options['hidden'] = $hidden;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定数据表别名
|
||||
* @access public
|
||||
@@ -2342,14 +2318,6 @@ class Query
|
||||
if (!empty($options['with_count'])) {
|
||||
$model->relationCount($model, $options['with_count']);
|
||||
}
|
||||
|
||||
// 显式或隐藏属性
|
||||
if (!empty($options['visible'])) {
|
||||
$model->visible($options['visible']);
|
||||
} elseif (!empty($options['hidden'])) {
|
||||
$model->hidden($options['hidden']);
|
||||
}
|
||||
|
||||
$resultSet[$key] = $model;
|
||||
}
|
||||
if (!empty($options['with'])) {
|
||||
@@ -2461,12 +2429,6 @@ class Query
|
||||
if (!empty($options['with_count'])) {
|
||||
$data->relationCount($data, $options['with_count']);
|
||||
}
|
||||
// 显式或隐藏属性
|
||||
if (!empty($options['visible'])) {
|
||||
$data->visible($options['visible']);
|
||||
} elseif (!empty($options['hidden'])) {
|
||||
$data->hidden($options['hidden']);
|
||||
}
|
||||
}
|
||||
} elseif (!empty($options['fail'])) {
|
||||
$this->throwNotFound($options);
|
||||
|
||||
Reference in New Issue
Block a user