WIP
parent
e9cb90567a
commit
166b260d2c
|
|
@ -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,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue