Finance.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: lofate
  5. * Date: 2019/11/28
  6. * TIME: 10:16
  7. */
  8. namespace app\adminapi\controller\v1\finance;
  9. use app\models\finance\FinanceModel;
  10. use app\models\user\{User,UserBill};
  11. use app\adminapi\controller\AuthController;
  12. use crmeb\services\UtilService as Util;
  13. class Finance extends AuthController
  14. {
  15. /**
  16. * 筛选类型
  17. */
  18. public function bill_type()
  19. {
  20. $list = UserBill::where('type', 'not in', ['gain', 'system_sub', 'deduction', 'sign'])
  21. ->where('mer_id', $this->merId)
  22. ->where('category', 'not in', 'integral')
  23. ->field(['title', 'type'])
  24. ->group('type')
  25. ->distinct(true)
  26. ->select();
  27. return $this->success(compact('list'));
  28. }
  29. /**
  30. * 资金记录
  31. */
  32. public function list()
  33. {
  34. $where = Util::getMore([
  35. ['start_time', ''],
  36. ['end_time', ''],
  37. ['nickname', ''],
  38. ['limit', 20],
  39. ['page', 1],
  40. ['type', ''],
  41. ]);
  42. $where['mer_id'] = $this->merId;
  43. return $this->success(FinanceModel::getBillList($where));
  44. }
  45. /**
  46. * 佣金记录
  47. */
  48. public function get_commission_list()
  49. {
  50. $where = Util::getMore([
  51. ['page', 1],
  52. ['limit', 20],
  53. ['nickname', ''],
  54. ['price_max', ''],
  55. ['price_min', ''],
  56. ['excel', ''],
  57. ]);
  58. $where['mer_id'] = $this->merId;
  59. return $this->success(User::getCommissionList($where));
  60. }
  61. /**
  62. * 佣金详情用户信息
  63. */
  64. public function user_info($id = '')
  65. {
  66. if ($id == '') return $this->fail('缺少参数');
  67. $user_info=User::userInfo($id);
  68. return $this->success(compact('user_info'));
  69. }
  70. /**
  71. * 佣金提现记录个人列表
  72. */
  73. public function get_extract_list($id = '')
  74. {
  75. if ($id == '') return $this->fail('缺少参数');
  76. $where = Util::getMore([
  77. ['page', 1],
  78. ['limit', 20],
  79. ['start_time', ''],
  80. ['end_time', ''],
  81. ['nickname', '']
  82. ]);
  83. return $this->success(UserBill::getExtrctOneList($where, $id));
  84. }
  85. }