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');