FranchiseeController.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\admin\controller\goods;
  3. use app\admin\service\goods\PartnerService;
  4. use app\admin\validate\goods\GoodsValidate;
  5. use support\Request;
  6. use support\Response;
  7. class FranchiseeController
  8. {
  9. /**
  10. * @Desc 商品详情
  11. * @Author Gorden
  12. * @Date 2024/3/28 10:25
  13. *
  14. * @param Request $request
  15. * @return Response
  16. */
  17. public function info(Request $request)
  18. {
  19. $validate = new GoodsValidate();
  20. if (!$validate->scene('info')->check($request->get())) {
  21. return json_fail($validate->getError());
  22. }
  23. return PartnerService::info($request->get('goods_id'));
  24. }
  25. /**
  26. * @Desc 修改商品
  27. * @Author Gorden
  28. * @Date 2024/3/28 13:22
  29. *
  30. * @param Request $request
  31. * @return Response
  32. */
  33. public function update(Request $request): Response
  34. {
  35. $validate = new GoodsValidate();
  36. if (!$validate->scene('update')->check($request->post())) {
  37. return json_fail($validate->getError());
  38. }
  39. return PartnerService::update($request->post());
  40. }
  41. }