AccountController.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 balance()
  74. {
  75. $params =request()->post();
  76. $pageSize = request()->post('pageSize', 15);
  77. $params['user_id'] = isset($params['user_id'])? $params['user_id'] : $this->userId;
  78. $datas = BalanceLogService::make()->getDataList($params, $pageSize);
  79. return showJson(1010, true, $datas);
  80. }
  81. }