|
@@ -1,11 +1,11 @@
|
|
|
<?php
|
|
<?php
|
|
|
namespace app\api\controller;
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
|
|
+use app\api\lists\FirmGoodLists;
|
|
|
use app\api\lists\GoodsLists;
|
|
use app\api\lists\GoodsLists;
|
|
|
use app\api\logic\GoodsLogic;
|
|
use app\api\logic\GoodsLogic;
|
|
|
-use app\api\logic\UserCouponLogic;
|
|
|
|
|
use app\api\validate\GoodsValidate;
|
|
use app\api\validate\GoodsValidate;
|
|
|
-use app\api\validate\UserCouponValidate;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 用户控制器
|
|
* 用户控制器
|
|
@@ -40,4 +40,30 @@ class GoodsController extends BaseApiController
|
|
|
$result = GoodsLogic::detail($params['id'],'goods');
|
|
$result = GoodsLogic::detail($params['id'],'goods');
|
|
|
return $this->data($result);
|
|
return $this->data($result);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public function firmGoodLists()
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->dataLists(new FirmGoodLists());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function firmGoodDetail(){
|
|
|
|
|
+ $params = (new GoodsValidate())->get()->goCheck('goods',[
|
|
|
|
|
+ 'user_id'=>$this->userId
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $result = GoodsLogic::firmGoodsDetail($params);
|
|
|
|
|
+ if (false !== $result) {
|
|
|
|
|
+ return $this->data($result);
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->fail(GoodsLogic::getError());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function submitFirmGood()
|
|
|
|
|
+ {
|
|
|
|
|
+ $params = (new GoodsValidate())->post()->goCheck('submitGood');
|
|
|
|
|
+ $result = GoodsLogic::sync($params,$this->userId);
|
|
|
|
|
+ if (true === $result) {
|
|
|
|
|
+ return $this->success('已提交', [], 1, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->fail(GoodsLogic::getError());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|