MemberRechargeBenefitController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\admin\controller\goods;
  3. use app\admin\service\goods\GoodsService;
  4. use app\admin\service\goods\MemberRechargeBenefitService;
  5. use app\admin\service\goods\PartnerService;
  6. use app\admin\validate\goods\GoodsValidate;
  7. use support\Request;
  8. use support\Response;
  9. class MemberRechargeBenefitController
  10. {
  11. /**
  12. * @Desc 列表
  13. * @Author Gorden
  14. * @Date 2024/3/28 10:08
  15. *
  16. * @param Request $request
  17. * @return Response
  18. */
  19. public function select(Request $request)
  20. {
  21. return MemberRechargeBenefitService::select($request, 'RECHARGE');
  22. }
  23. public function selectCascaderList(Request $request)
  24. {
  25. return MemberRechargeBenefitService::selectCascaderList($request);
  26. }
  27. /**
  28. * @Desc 商品详情
  29. * @Author Gorden
  30. * @Date 2024/3/28 10:25
  31. *
  32. * @param Request $request
  33. * @return Response
  34. */
  35. public function info(Request $request)
  36. {
  37. $validate = new GoodsValidate();
  38. if (!$validate->scene('info')->check($request->get())) {
  39. return json_fail($validate->getError());
  40. }
  41. return MemberRechargeBenefitService::info($request->get('goods_id'));
  42. }
  43. /**
  44. * @Desc 修改商品
  45. * @Author Gorden
  46. * @Date 2024/3/28 13:22
  47. *
  48. * @param Request $request
  49. * @return Response
  50. */
  51. public function update(Request $request): Response
  52. {
  53. $validate = new GoodsValidate();
  54. if (!$validate->scene('update')->check($request->post())) {
  55. return json_fail($validate->getError());
  56. }
  57. return MemberRechargeBenefitService::update($request->post());
  58. }
  59. }