update value comment

This commit is contained in:
whale
2020-04-26 16:04:02 +08:00
parent 94834c6625
commit c632977ca1

View File

@@ -44,10 +44,12 @@ class SelectBody
return $this->fetchAll()[0] ?? null; return $this->fetchAll()[0] ?? null;
} }
public function value() { public function value($key = null) {
$r = $this->fetchFirst(); $r = $this->fetchFirst();
if ($r === null) return null; if ($r === null) return null;
return current($r); if ($key === null)
return current($r);
else return $r[$key] ?? null;
} }
public function execute() { public function execute() {