|
|
@@ -1,15 +1,18 @@
|
|
|
<?php
|
|
|
declare(strict_types=1);
|
|
|
+
|
|
|
namespace SixShop\WechatPay\Controller;
|
|
|
|
|
|
use SixShop\Core\Request;
|
|
|
use SixShop\WechatPay\Entity\WechatpayTransferBillEntity;
|
|
|
use SixShop\WechatPay\Enum\TransferBillStatusEnum;
|
|
|
+use think\Response;
|
|
|
use function SixShop\Core\page_response;
|
|
|
+use function SixShop\Core\success_response;
|
|
|
|
|
|
class TransferBillController
|
|
|
{
|
|
|
- public function index(Request $request, WechatpayTransferBillEntity $transferBillEntity)
|
|
|
+ public function index(Request $request, WechatpayTransferBillEntity $transferBillEntity): Response
|
|
|
{
|
|
|
$params = $request->get([
|
|
|
'state/s' => 'all',
|
|
|
@@ -18,12 +21,22 @@ class TransferBillController
|
|
|
$page = $request->pageAndLimit();
|
|
|
$stats = $transferBillEntity->getTransferBillStats($params);
|
|
|
return page_response(
|
|
|
- page:$transferBillEntity->getTransferBillList($params, $page)
|
|
|
+ page: $transferBillEntity->getTransferBillList($params, $page)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- public function refresh(int $id, WechatpayTransferBillEntity $transferBillEntity)
|
|
|
+ public function refresh(int $id, WechatpayTransferBillEntity $transferBillEntity): Response
|
|
|
{
|
|
|
return success_response($transferBillEntity->refreshTransferBill($id));
|
|
|
}
|
|
|
+
|
|
|
+ public function approve(int $id, WechatpayTransferBillEntity $transferBillEntity): Response
|
|
|
+ {
|
|
|
+ return success_response($transferBillEntity->approveTransferBill($id));
|
|
|
+ }
|
|
|
+
|
|
|
+ public function reject(int $id, Request $request, WechatpayTransferBillEntity $transferBillEntity): Response
|
|
|
+ {
|
|
|
+ return success_response($transferBillEntity->rejectTransferBill($id, $request->post('fail_reason/s')));
|
|
|
+ }
|
|
|
}
|