Closed bodyTop closed 3 years ago
表查询结果后转数组 $taskInfo->toArray() 2.[Too few arguments to function EasySwoole\ORM\AbstractModel::hidden(), 0 passed in 遇到此报错 3.public function getAttr($attrName) {
$method = 'get' . str_replace( ' ', '', ucwords( str_replace( ['-', '_'], ' ', $attrName ) ) ) . 'Attr'; if (method_exists($this, $method)) { return call_user_func([$this,$method],$this->data[$attrName] ?? null, $this->data); } // 判断是否有关联查询 $notWhile = ['count', 'where', 'order', 'alias', 'join', 'with', 'max', 'min', 'avg','sum', 'field', 'get', 'all', 'delete', 'result']; if (method_exists($this, $attrName) && !in_array($attrName, $notWhile) ) { 我的数据表中存在一个hidden字段, 这里会自动去调用对象中hidden的属性 return $this->$attrName(); } // 是否是附加字段 if (isset($this->_joinData[$attrName])){ return $this->_joinData[$attrName]; } return $this->data[$attrName] ?? null;
}
版本过低,升级后重试
easyswoole框架版本号 3.3.6、orm组件版本号 1.4.5
问题描述和截图 [Question]
表查询结果后转数组 $taskInfo->toArray() 2.[Too few arguments to function EasySwoole\ORM\AbstractModel::hidden(), 0 passed in 遇到此报错 3.public function getAttr($attrName) {
}
排查情况和最小复现脚本 [Tests and Recurrence]