circulation_id = $data['circulation_id'] ?? 0; $this->user_id = $data['user_id'] ?? 0; $this->from_point_id = $data['from_point_id'] ?? 0; $this->to_point_id = $data['to_point_id'] ?? 0; $this->amount = $data['amount'] ?? 0; $this->remark = $data['remark'] ?? ''; } /** * 转换为数组 * * @return array */ public function toArray(): array { return [ 'circulation_id' => $this->circulation_id, 'user_id' => $this->user_id, 'from_point_id' => $this->from_point_id, 'to_point_id' => $this->to_point_id, 'amount' => $this->amount, 'remark' => $this->remark, ]; } }