<?php
namespace jd_vop\response\order;
use jd_vop\response\Result;
class CheckNewOrder implements Result
{
public $total;
public $totalPage;
public $curPage;
public $orders;
public function __construct(int $total, int $totalPage, int $curPage, array $orders)
{
$this->total = $total;
$this->totalPage = $totalPage;
$this->curPage = $curPage;
$this->orders = $orders;
}
public static function parse($result): self
{
$total = $result['total'] ?? 0;
$totalPage = $result['total'] ?? 0;
$curPage = $result['total'] ?? 0;
$orders = [];
foreach ($result['orders'] ?? [] as $v) {
$orders[] = CheckOrderOrder::parse($v);
}
return new self($total, $totalPage, $curPage, $orders);
}
}