| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace app\api\controller;
- use app\api\lists\FirmGoodLists;
- use app\api\lists\recharge\FirmOrderLists;
- use app\api\logic\FirmLogic;
- use app\api\logic\GoodsLogic;
- use app\api\validate\FirmRegisterValidate;
- use app\api\validate\GoodsValidate;
- class FirmController extends BaseApiController
- {
- public array $notNeedLogin = [];
- /**
- * 企业注册
- * @return \think\response\Json
- * @author 林海涛
- * @date 2024/7/12 下午2:17
- */
- public function register()
- {
- $params = (new FirmRegisterValidate())->post()->goCheck('register');
- $result = FirmLogic::register($params,$this->userId);
- if (true === $result) {
- return $this->success('已提交', [], 1, 1);
- }
- return $this->fail(FirmLogic::getError());
- }
- public function orderLists()
- {
- return $this->dataLists(new FirmOrderLists());
- }
- public function submitOrder()
- {
- }
- public function goodLists()
- {
- return $this->dataLists(new FirmGoodLists());
- }
- public function goodDetail(){
- $params = (new GoodsValidate())->get()->goCheck('goods');
- $result = GoodsLogic::detail($params['id'],'goods');
- return $this->data($result);
- }
- public function submitGood()
- {
- $params = (new GoodsValidate())->post()->goCheck('add');
- $result = GoodsLogic::sync($params,$this->userId);
- if (true === $result) {
- return $this->success('已提交', [], 1, 1);
- }
- return $this->fail(FirmLogic::getError());
- }
- }
|