DepositController.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Services\Common\DepositService;
  4. /**
  5. * 保证金管理
  6. * @package App\Http\Controllers\Admin
  7. */
  8. class DepositController extends Backend
  9. {
  10. /**
  11. * 构造函数
  12. * @author laravel开发员
  13. * @since 2020/11/11
  14. * GoodsController constructor.
  15. */
  16. public function __construct()
  17. {
  18. parent::__construct();
  19. $this->service = new DepositService();
  20. }
  21. /**
  22. * 列表
  23. * @return array
  24. */
  25. public function index()
  26. {
  27. $pageSize = request()->get('limit', 10);
  28. $list = $this->service->getDataList(request()->all(), $pageSize);
  29. $message = array(
  30. "msg" => '操作成功',
  31. "code" => 0,
  32. "data" => isset($list['list'])? $list['list']:[],
  33. "counts" => isset($list['counts'])? $list['counts']:[],
  34. "count" => isset($list['total'])? $list['total']:0,
  35. );
  36. return $message;
  37. }
  38. /**
  39. * 审核
  40. * @return array
  41. */
  42. public function confirm()
  43. {
  44. $params = request()->post();
  45. if(DepositService::make()->confirm($this->userId,$params)){
  46. return message(DepositService::make()->getError(), true);
  47. }else{
  48. return message(DepositService::make()->getError(), false);
  49. }
  50. }
  51. /**
  52. * 打款
  53. * @return array
  54. */
  55. public function payment()
  56. {
  57. $params = request()->post();
  58. if(DepositService::make()->payment($this->userId,$params)){
  59. return message(DepositService::make()->getError(), true);
  60. }else{
  61. return message(DepositService::make()->getError(), false);
  62. }
  63. }
  64. /**
  65. * 删除数据
  66. * @return mixed
  67. * @since 2020/11/11
  68. * @author laravel开发员
  69. */
  70. public function delete()
  71. {
  72. $result = $this->service->delete();
  73. return $result;
  74. }
  75. }