getPurchaseSubsidyLogs(); return [ 'id' => $this->id, 'type' => $this->type_name, 'created_at' => $this->created_at->toDateTimeString(), 'total_amount' => $this->total_amount, 'fee_rate' => $this->fee_rate, 'fee' => $this->fee, 'total_earnings'=> $this->total_earnings, 'status' => $this->settle_at ? $this->status : -1, 'status_name' => $this->status_name, 'remark' => $this->remark, 'pay_info' => $this->getPayInfo(), 'pay_image' => $this->pay_image, 'pay_at' => $this->pay_at?->toDateTimeString(), 'is_payer' => $this->payer_id ? ($this->payer_id == $request->user()->id) : false, 'purchase_subsidy_logs' => $purchaseSubsidyLogs ? DealerEarningSubsidyLogResource::collection($purchaseSubsidyLogs) : null, ]; } }