RechargeController.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 LARAVEL研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: laravel开发员 <laravel.qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Http\Controllers\Admin;
  12. use App\Services\Common\AccountService;
  13. use App\Services\Common\BalanceLogService;
  14. /**
  15. * 充值管理-控制器
  16. * @author laravel开发员
  17. * @since 2020/11/11
  18. * @package App\Http\Controllers
  19. */
  20. class RechargeController extends Backend
  21. {
  22. /**
  23. * 构造函数
  24. * @author laravel开发员
  25. * @since 2020/11/11
  26. */
  27. public function __construct()
  28. {
  29. parent::__construct();
  30. $this->service = new BalanceLogService();
  31. }
  32. /**
  33. * 列表
  34. * @return array
  35. */
  36. public function index()
  37. {
  38. $pageSize = request()->get('limit', 10);
  39. $list = $this->service->getDataList(request()->all(), $pageSize);
  40. $message = array(
  41. "msg" => '操作成功',
  42. "code" => 0,
  43. "data" => isset($list['list'])? $list['list']:[],
  44. "count" => isset($list['total'])? $list['total']:0,
  45. );
  46. return $message;
  47. }
  48. /**
  49. * 统计
  50. * @return array
  51. */
  52. public function count()
  53. {
  54. $datas = $this->service->getCount(request()->all());
  55. $message = array(
  56. "msg" => '操作成功',
  57. "code" => 0,
  58. "data" => $datas,
  59. );
  60. return $message;
  61. }
  62. /**
  63. * 审核
  64. * @return mixed
  65. */
  66. public function auth(){
  67. $params = request()->post();
  68. if(!$result = BalanceLogService::make()->rechargeAuth($params)){
  69. return showJson(BalanceLogService::make()->getError(), false);
  70. }else{
  71. return showJson(BalanceLogService::make()->getError(), true);
  72. }
  73. }
  74. }