123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?php
- // +----------------------------------------------------------------------
- // | Niucloud-admin 企业快速开发的saas管理平台
- // +----------------------------------------------------------------------
- // | 官方网址:https://www.niucloud.com
- // +----------------------------------------------------------------------
- // | niucloud团队 版权所有 开源版本可自由商用
- // +----------------------------------------------------------------------
- // | Author: Niucloud Team
- // +----------------------------------------------------------------------
- namespace app\adminapi\controller\pay;
- use app\dict\common\ChannelDict;
- use app\dict\pay\PayDict;
- use app\service\admin\pay\PayService;
- use core\base\BaseAdminController;
- use think\Response;
- class Pay extends BaseAdminController
- {
- /**
- * 待审核支付记录
- * @return Response
- */
- public function lists(){
- $data = $this->request->params([
- ['create_time', []],
- ['out_trade_no', ''],
- ['type', ''],
- ['channel', '']
- ]);
- return success(data: (new PayService())->getPage($data));
- }
- /**
- * 待审核支付记录
- * @return Response
- */
- public function audit(){
- $data = $this->request->params([
- ['create_time', []],
- ['out_trade_no', ''],
- ['status', '']
- ]);
- return success(data: (new PayService())->getAuditPage($data));
- }
- /**
- * 查询详情
- * @param int $id
- * @return \think\Response
- */
- public function detail(int $id){
- return success(data: (new PayService())->getDetail($id));
- }
- /**
- * 支付审核通过
- * @param string $out_trade_no
- * @return \think\Response
- */
- public function pass(string $out_trade_no){
- return success(data: (new PayService())->pass($out_trade_no));
- }
- /**
- * 审核拒绝
- * @param string $out_trade_no
- * @return Response
- */
- public function refuse(string $out_trade_no){
- $reason = input('reason', '');
- return success(data: (new PayService())->refuse($out_trade_no, $reason));
- }
- /**
- * 获取支付方式列表
- * @return \think\Response
- */
- public function getTypeList()
- {
- $list = array_filter(PayDict::getPayType(), function($value){
- return $value['key'] !== PayDict::FRIENDSPAY;
- });
- return success(data: $list);
- }
- /**
- * 获取支付渠道
- * @return \think\Response
- */
- public function getChannelList()
- {
- return success(ChannelDict::getType());
- }
- /**
- * 按支付方式统计支付金额
- * @return \think\Response
- */
- public function typeStat()
- {
- return success((new PayService())->getPayTypeStat());
- }
- /**
- * 按支付渠道统计支付金额
- * @return \think\Response
- */
- public function channelStat()
- {
- return success((new PayService())->getChannelStat());
- }
- }
|