6
0
Fork 0
release
李静 2021-12-15 19:50:58 +08:00
parent e9cb90567a
commit 166b260d2c
2 changed files with 13 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class OrderSimpleResource extends JsonResource
'status' => $this->status, 'status' => $this->status,
'created_date' => $this->created_at->toDateString(), 'created_date' => $this->created_at->toDateString(),
'products' => OrderProductResource::collection($this->whenLoaded('products')), 'products' => OrderProductResource::collection($this->whenLoaded('products')),
'expires_at' => $this->expires_at,
]; ];
} }
} }

View File

@ -65,4 +65,16 @@ class Order extends Model
{ {
return Numeric::trimTrailingZero(bcdiv($this->attributes['total_amount'], 100, 2)); return Numeric::trimTrailingZero(bcdiv($this->attributes['total_amount'], 100, 2));
} }
/**
* 待支付订单过期时间
*
* @return int
*/
public function getExpiresAtAttribute()
{
// todo 待支付订单过期时间
return 3600;
}
} }