ShareController.php 952 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Created by PhpStorm
  4. * DateTime: 2022/11/5 0:31
  5. *
  6. * @description
  7. */
  8. namespace App\Http\Controllers\V1\Share;
  9. use App\Http\Controllers\V1\Controller;
  10. use App\Models\ShareConfig;
  11. use App\Models\UserWithdraw;
  12. class ShareController extends Controller
  13. {
  14. public function income()
  15. {
  16. // 已提现
  17. $been = UserWithdraw::where('user_id', \user()->id)
  18. ->where('status', 2)
  19. ->sum('price');
  20. // 待打款
  21. $wait = UserWithdraw::where('user_id', \user()->id)
  22. ->where('status', 1)
  23. ->sum('price');
  24. return $this->success([
  25. 'been' =>$been,
  26. 'wait' =>$wait,
  27. ]);
  28. }
  29. public function tips()
  30. {
  31. $config = ShareConfig::first();
  32. return $this->success($config->withdraw_desc);
  33. }
  34. public function setting()
  35. {
  36. $config = ShareConfig::first();
  37. return $this->success($config);
  38. }
  39. }