AccountController.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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'=>25,'name'=>'付款给商家'],
  50. ['id'=>99,'name'=>'其他'],
  51. // ['id'=>13,'name'=>'管理奖励'],
  52. // ['id'=>14,'name'=>'点对点奖励'],
  53. // ['id'=>15,'name'=>'全球分红奖励'],
  54. // ['id'=>97,'name'=>'等级烧伤损失'],
  55. ];
  56. return showJson(1010, true, $datas);
  57. }
  58. /**
  59. * 统计
  60. * @return array
  61. */
  62. public function counts()
  63. {
  64. $coinType =request()->post('coin_type',1);
  65. $userType =request()->post('user_type',1);
  66. $type =request()->post('type',1);
  67. $datas = AccountLogService::make()->getCountsByType($this->userId, $coinType, $userType, $type);
  68. return showJson(1010, true, $datas);
  69. }
  70. /**
  71. * 积分统计
  72. * @return array
  73. */
  74. public function scoreCount()
  75. {
  76. $coinType =request()->post('coin_type',4);
  77. $datas = AccountLogService::make()->getScoreCounts(0, $coinType);
  78. return showJson(1010, true, $datas);
  79. }
  80. /**
  81. * 余额明细
  82. * @return array
  83. */
  84. public function balance()
  85. {
  86. $params =request()->post();
  87. $pageSize = request()->post('pageSize', 15);
  88. $params['user_id'] = isset($params['user_id']) && $params['user_id']? $params['user_id'] : $this->userId;
  89. $datas = BalanceLogService::make()->getDataList($params, $pageSize);
  90. return showJson(1010, true, $datas);
  91. }
  92. }