deriver_id; } /** * @param int $deriver_id */ public function setDeriverId(int $deriver_id) { $this->deriver_id = $deriver_id; } public function __construct($deriver_id) { $this->deriver_id = $deriver_id; } /** * json_encode无法转化私有属性,需要使用jsonSerialize自定义转换私有的属性 * @return array */ public function jsonSerialize(): array { return [ "deriver_id" => $this->deriver_id, ]; } }