老师,各位大神,我想问个问题,
// 修改状态
public function status() {
$data = input('get.');
$validate = validate('Category');
if (!$validate->scene('status')->check($data)) {
$this->error($validate->getError());
}
$res = $this->obj->save(['status' => $data['status']], ['id' => $data['id']]);
if ($res) {
$this->result('状态更新成功');
} else {
$this->result('状态更新失败');
}
}
在更新状态的地方,状态可以更新成功,$res的值也是1,
$this->result的地方出错.页面刷新后报这个错误
[0] InvalidArgumentException in Response.php line 315
variable type error: array
{
if (null == $this->content) {
$content = $this->output($this->data);
if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
$content,
'__toString',
])
) {
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
}
$this->content = (string) $content;
}
return $this->content;
}
/**
* 获取状态码
Call Stack
in Response.php line 315
at Response->getContent() in Response.php line 93
at Response->send() in start.php line 18
有人遇到吗?