AccountController.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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'] : $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. $datas = AccountLogService::make()->getCountsByType($this->userId, $coinType, $userType);
  66. return showJson(1010, true, $datas);
  67. }
  68. /**
  69. * 余额明细
  70. * @return array
  71. */
  72. public function balance()
  73. {
  74. $params =request()->post();
  75. $pageSize = request()->post('pageSize', 15);
  76. $params['user_id'] = isset($params['user_id'])? $params['user_id'] : $this->userId;
  77. $datas = BalanceLogService::make()->getDataList($params, $pageSize);
  78. return showJson(1010, true, $datas);
  79. }
  80. }