WalletController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Http\Validator\CoinValidator;
  4. use App\Services\Api\AdvertService;
  5. use App\Services\Api\MemberWalletService;
  6. use App\Services\Common\CoinLogService;
  7. /**
  8. * 用户地址簿
  9. * Class WalletController
  10. * @package App\Http\Controllers\Api
  11. */
  12. class WalletController extends webApp
  13. {
  14. /**
  15. * 获取列表
  16. * @return array|mixed
  17. */
  18. public function index()
  19. {
  20. $pageSize = request()->post('pageSize', 15);
  21. $type = request()->post('type', 1);
  22. $list = MemberWalletService::make()->getOptionList($this->userId, $type, $pageSize);
  23. return message(1010, true, $list);
  24. }
  25. /**
  26. * 提币
  27. * @return array
  28. */
  29. public function withdraw(CoinValidator $validate)
  30. {
  31. $params = request()->post();
  32. $params = $validate->check($params,'withdraw');
  33. if(!is_array($params)){
  34. return message($params, false,[]);
  35. }
  36. if(!CoinLogService::make()->withdraw($this->userInfo['user_id'], $params)){
  37. return message(CoinLogService::make()->getError(), false);
  38. }else{
  39. return message(CoinLogService::make()->getError(), true);
  40. }
  41. }
  42. public function add()
  43. {
  44. }
  45. public function del()
  46. {
  47. }
  48. }