diffInSeconds($this->created_at->addMinutes(config('aslong_order.auto_cancel_order')), false); return [ 'id' => $this->id, 'orderid' => $this->orderid, 'goods_list' => OrderDetailResource::collection($this->details), 'state' => $this->state, 'state_text' => $this->state_text, 'total' => number_format($this->total, 2), 'amount' => number_format($this->amount, 2), 'freight' => number_format($this->freight, 2), 'handleOption' => [ 'pay' => $this->canPay(), ], 'created_at' => (string) $this->created_at, 'paid' => $this->when($this->paid_at, [ 'paid_at' => (string) $this->payment->end_at, 'type' => strip_tags($this->payment->type_text), 'transaction_id' => $this->payment->transaction_id, ]), ]; } }