AccountController.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. namespace App\Http\Controllers\Api\v1;
  3. use App\Http\Controllers\Api\webApp;
  4. use App\Services\Api\AccountLogService;
  5. use App\Services\Api\BalanceLogService;
  6. /**
  7. * 账单明细
  8. * Class AccountController
  9. * @package App\Http\Controllers\Api
  10. */
  11. class AccountController extends webApp
  12. {
  13. /**
  14. * 列表
  15. * @return array
  16. */
  17. public function index()
  18. {
  19. $params =request()->post();
  20. $pageSize = request()->post('pageSize', 15);
  21. $params['user_id'] = isset($params['user_id']) && $params['user_id']? $params['user_id'] : $this->userId;
  22. $datas = AccountLogService::make()->getDataList($params, $pageSize);
  23. if($datas){
  24. return showJson(1010, true, $datas);
  25. }else{
  26. return showJson(1009, false);
  27. }
  28. }
  29. /**
  30. * 列表
  31. * @return array
  32. */
  33. public function types()
  34. {
  35. $datas = [
  36. ['id'=>0,'name'=>'全部'],
  37. ['id'=>1,'name'=>'礼物打赏'],
  38. ['id'=>2,'name'=>'升级消费'],
  39. ['id'=>3,'name'=>'商城购物'],
  40. ['id'=>4,'name'=>'节点会员升级'],
  41. ['id'=>5,'name'=>'充值/提现'],
  42. ['id'=>6,'name'=>'转账'],
  43. ['id'=>7,'name'=>'退款'],
  44. ['id'=>8,'name'=>'平台充兑'],
  45. ['id'=>9,'name'=>'奖励收益'],
  46. ['id'=>10,'name'=>'佣金/提成'],
  47. ['id'=>11,'name'=>'打赏小费'],
  48. ['id'=>12,'name'=>'团队奖励'],
  49. ['id'=>99,'name'=>'其他'],
  50. // ['id'=>13,'name'=>'管理奖励'],
  51. // ['id'=>14,'name'=>'点对点奖励'],
  52. // ['id'=>15,'name'=>'全球分红奖励'],
  53. // ['id'=>97,'name'=>'等级烧伤损失'],
  54. ];
  55. return showJson(1010, true, $datas);
  56. }
  57. /**
  58. * 统计
  59. * @return array
  60. */
  61. public function counts()
  62. {
  63. $coinType =request()->post('coin_type',1);
  64. $userType =request()->post('user_type',1);
  65. $type =request()->post('type',1);
  66. $datas = AccountLogService::make()->getCountsByType($this->userId, $coinType, $userType, $type);
  67. return showJson(1010, true, $datas);
  68. }
  69. /**
  70. * 积分统计
  71. * @return array
  72. */
  73. public function scoreCount()
  74. {
  75. $coinType =request()->post('coin_type',4);
  76. $datas = AccountLogService::make()->getScoreCounts(0, $coinType);
  77. return showJson(1010, true, $datas);
  78. }
  79. /**
  80. * 余额明细
  81. * @return array
  82. */
  83. public function balance()
  84. {
  85. $params =request()->post();
  86. $pageSize = request()->post('pageSize', 15);
  87. $params['user_id'] = isset($params['user_id']) && $params['user_id']? $params['user_id'] : $this->userId;
  88. $datas = BalanceLogService::make()->getDataList($params, $pageSize);
  89. return showJson(1010, true, $datas);
  90. }
  91. }