FirmController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\lists\FirmGoodLists;
  4. use app\api\lists\recharge\FirmOrderLists;
  5. use app\api\logic\FirmLogic;
  6. use app\api\logic\GoodsLogic;
  7. use app\api\validate\FirmRegisterValidate;
  8. use app\api\validate\GoodsValidate;
  9. class FirmController extends BaseApiController
  10. {
  11. public array $notNeedLogin = [];
  12. /**
  13. * 企业注册
  14. * @return \think\response\Json
  15. * @author 林海涛
  16. * @date 2024/7/12 下午2:17
  17. */
  18. public function register()
  19. {
  20. $params = (new FirmRegisterValidate())->post()->goCheck('register');
  21. $result = FirmLogic::register($params,$this->userId);
  22. if (true === $result) {
  23. return $this->success('已提交', [], 1, 1);
  24. }
  25. return $this->fail(FirmLogic::getError());
  26. }
  27. public function orderLists()
  28. {
  29. return $this->dataLists(new FirmOrderLists());
  30. }
  31. public function submitOrder()
  32. {
  33. }
  34. public function goodLists()
  35. {
  36. return $this->dataLists(new FirmGoodLists());
  37. }
  38. public function submitGood()
  39. {
  40. $params = (new GoodsValidate())->post()->goCheck('add');
  41. $result = GoodsLogic::sync($params,$this->userId);
  42. if (true === $result) {
  43. return $this->success('已提交', [], 1, 1);
  44. }
  45. return $this->fail(FirmLogic::getError());
  46. }
  47. }