GongdengController.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. namespace App\Http\Controllers\Api\v1;
  3. use App\Http\Controllers\Api\BaseController;
  4. use App\Http\Validator\GongdengValidator;
  5. use App\Services\GongdengOrderService;
  6. use App\Services\GongdengFoxiangService;
  7. use App\Services\LampMealsService;
  8. /**
  9. * 供灯控制器类
  10. * @author wesmiler
  11. * @since 2020/11/10
  12. * Class GongdengController
  13. * @package App\Http\Controllers
  14. */
  15. class GongdengController extends BaseController
  16. {
  17. /**
  18. * 构造函数
  19. * @author wesmiler
  20. * @since 2020/11/11
  21. * GongdengController constructor.
  22. */
  23. public function __construct()
  24. {
  25. parent::__construct();
  26. $this->service = new GongdengOrderService();
  27. $this->fxService = new GongdengFoxiangService();
  28. $this->mealService = new LampMealsService();
  29. }
  30. /**
  31. * 套餐列表
  32. * @return mixed
  33. */
  34. public function index(){
  35. return $this->service->getMyGdList($this->userId);
  36. }
  37. /**
  38. * 佛像列表
  39. * @return mixed
  40. */
  41. public function fxInfo(){
  42. return $this->fxService->info();
  43. }
  44. /**
  45. * 佛像列表
  46. * @return mixed
  47. */
  48. public function fxList(){
  49. return $this->fxService->getList();
  50. }
  51. /**
  52. * 套餐列表
  53. * @return mixed
  54. */
  55. public function mealList(){
  56. return $this->mealService->getDataList();
  57. }
  58. /**
  59. * 功德榜记录
  60. * @return mixed
  61. */
  62. public function gdList(){
  63. return $this->service->getGdList();
  64. }
  65. /**
  66. * 供灯下单
  67. * @return mixed
  68. */
  69. public function buy(GongdengValidator $validate){
  70. $params = $validate->check(request()->all(),'buy');
  71. if(!is_array($params)){
  72. return message($params, false);
  73. }
  74. return $this->service->buy($this->userId);
  75. }
  76. }