57 lines
2.0 KiB
PHP
57 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\EcommerceFinance\Repositories;
|
|
|
|
/**
|
|
* 得物支付宝账户:从聚水潭淘系支付宝完整账单中读取指定主体的账户流水。
|
|
*
|
|
* 聚水潭导出的展示名可能在末尾追加 8 位日期后缀;本页按八家主体的标准名称锁定范围,
|
|
* 表格继续展示源账单中的原始账户名。
|
|
*/
|
|
class StoreReceivingDewuAlipayBillMirrorRepository
|
|
{
|
|
/** @var list<string> */
|
|
public const STORE_NAMES = [
|
|
'支付宝-常州春之华家居有限公司',
|
|
'支付宝-常州诗科家电子商务有限公司',
|
|
'支付宝-常州玖阔家居有限公司20240319',
|
|
'支付宝-常州阔之煜家居有限公司',
|
|
'支付宝-常州熊泽家居有限公司',
|
|
'支付宝-常州雄川家居有限公司',
|
|
'支付宝-常州泽之云家居有限公司',
|
|
'支付宝-常州君佰家居有限公司',
|
|
];
|
|
|
|
private readonly TaobaoAlipaySettlementBillRepository $source;
|
|
|
|
public function __construct(TaobaoAlipaySettlementBillRepository $source)
|
|
{
|
|
$this->source = $source->scopedToStores(self::STORE_NAMES);
|
|
}
|
|
|
|
/** @return array<string,mixed> */
|
|
public function paginate(array $filters, string $sort, string $direction, int $page, int $perPage): array
|
|
{
|
|
return $this->source->paginate($filters, $sort, $direction, $page, $perPage);
|
|
}
|
|
|
|
/** @return iterable<int,array<string,mixed>> */
|
|
public function exportRows(array $filters, string $sort = 'occurred_at', string $direction = 'asc'): iterable
|
|
{
|
|
return $this->source->exportRows($filters, $sort, $direction);
|
|
}
|
|
|
|
/** @return array{shops:list<string>,bill_items:list<string>} */
|
|
public function filterOptions(): array
|
|
{
|
|
$options = $this->source->accountBillFilterOptions();
|
|
$shops = array_values(array_unique(array_merge(self::STORE_NAMES, $options['shops'])));
|
|
sort($shops, SORT_NATURAL);
|
|
|
|
return [
|
|
'shops' => $shops,
|
|
'bill_items' => $options['bill_items'],
|
|
];
|
|
}
|
|
}
|