From 0b96122b7d86cf32bea4f10771613d4204a197f6 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 7 Dec 2023 17:47:44 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=95=B0=E6=8D=AE=E4=B9=8B=E7=9C=BC-?= =?UTF-8?q?=E8=B4=A2=E5=8A=A1-=E6=8F=90=E7=8E=B0=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E8=B5=84=E9=87=91=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/dataview/Finance.php | 35 +++++++++++++++++++++++++ route/api.php | 2 ++ 2 files changed, 37 insertions(+) diff --git a/app/controller/api/dataview/Finance.php b/app/controller/api/dataview/Finance.php index e96c9617..0ee6ae09 100644 --- a/app/controller/api/dataview/Finance.php +++ b/app/controller/api/dataview/Finance.php @@ -3,6 +3,7 @@ namespace app\controller\api\dataview; use app\common\repositories\BaseRepository; +use app\common\repositories\system\merchant\FinancialRecordRepository; use app\common\repositories\user\UserBillRepository; use app\common\repositories\user\UserExtractRepository; use crmeb\basic\BaseController; @@ -31,6 +32,7 @@ class Finance extends BaseController } } + // 提现记录 public function withdrawList(UserExtractRepository $repository) { [$page,$limit] = $this->getPage(); @@ -38,10 +40,43 @@ class Finance extends BaseController return app('json')->success($repository->getList($where,$page,$limit)); } + // 资金记录 public function billList(UserBillRepository $repository) { [$page, $limit] = $this->getPage(); $where = $this->request->params(['keyword', 'date', 'type']); return app('json')->success($repository->getList($where, $page, $limit)); } + + // 账单管理统计标题 + public function financialRecordTitle(FinancialRecordRepository $repository) + { + $where = $this->request->params(['date']); + $where['is_mer'] = $this->request->merId() ?? 0 ; + if($where['is_mer'] == 0){ + $data = $repository->getAdminTitle($where); + }else{ + $data = $repository->getMerchantTitle($where); + } + return app('json')->success($data); + } + + public function financialRecord(FinancialRecordRepository $repository) + { + [$page, $limit] = $this->getPage(); + $where = $this->request->params(['keyword', 'date', 'mer_id']); + $merId = $this->request->merId(); + if ($merId) { + $where['mer_id'] = $merId; + $where['financial_type'] = ['order', 'mer_accoubts', 'brokerage_one', 'brokerage_two', 'refund_brokerage_one', 'refund_brokerage_two', 'refund_order','order_platform_coupon', + 'order_svip_coupon','commission_to_service_team','commission_to_service_team_refund','commission_to_platform','commission_to_platform_refund','commission_to_village','commission_to_village_refund','commission_to_town','commission_to_town_refund','commission_to_entry_merchant','commission_to_entry_merchant_refund' + ,'commission_to_cloud_warehouse','commission_to_cloud_warehouse_refund']; + } else { + $where['financial_type'] = ['order', 'sys_accoubts', 'brokerage_one', 'brokerage_two', 'refund_brokerage_one', 'refund_brokerage_two', 'refund_order','order_platform_coupon', + 'order_svip_coupon','commission_to_service_team','commission_to_service_team_refund','commission_to_platform','commission_to_platform_refund','commission_to_village','commission_to_village_refund','commission_to_town','commission_to_town_refund' + ,'commission_to_entry_merchant','commission_to_entry_merchant_refund' + ,'commission_to_cloud_warehouse','commission_to_cloud_warehouse_refund']; + } + return app('json')->success($repository->getList($where, $page, $limit)); + } } \ No newline at end of file diff --git a/route/api.php b/route/api.php index 07025988..01a52b35 100644 --- a/route/api.php +++ b/route/api.php @@ -759,6 +759,8 @@ Route::group('api/', function () { // api.dataview.Finance Route::get('withdraw_list', 'Finance/withdrawList'); Route::get('bill_list', 'Finance/billList'); + Route::get('financial_record_title', 'Finance/financialRecordTitle'); + Route::get('financial_record', 'Finance/financialRecord');