GongdengController.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 fxInfo(){
  35. return $this->fxService->info();
  36. }
  37. /**
  38. * 佛像列表
  39. * @return mixed
  40. */
  41. public function fxList(){
  42. return $this->fxService->getList();
  43. }
  44. /**
  45. * 套餐列表
  46. * @return mixed
  47. */
  48. public function mealList(){
  49. return $this->mealService->getDataList();
  50. }
  51. /**
  52. * 功德榜记录
  53. * @return mixed
  54. */
  55. public function gdList(){
  56. return $this->service->getList();
  57. }
  58. /**
  59. * 供灯下单
  60. * @return mixed
  61. */
  62. public function buy(GongdengValidator $validate){
  63. $params = $validate->check(request()->all(),'buy');
  64. if(!is_array($params)){
  65. return message($params, false);
  66. }
  67. return $this->service->buy($this->userId);
  68. }
  69. }