|
|
@@ -3,7 +3,9 @@ namespace app\api\controller;
|
|
|
|
|
|
use app\api\lists\GoodsLists;
|
|
|
use app\api\logic\GoodsLogic;
|
|
|
+use app\api\logic\UserCouponLogic;
|
|
|
use app\api\validate\GoodsValidate;
|
|
|
+use app\api\validate\UserCouponValidate;
|
|
|
|
|
|
/**
|
|
|
* 用户控制器
|
|
|
@@ -12,7 +14,7 @@ use app\api\validate\GoodsValidate;
|
|
|
*/
|
|
|
class GoodsController extends BaseApiController
|
|
|
{
|
|
|
- public array $notNeedLogin = ['lists','hotData','categoryDetail','goodsDetail'];
|
|
|
+ public array $notNeedLogin = ['lists','hotData','categoryDetail','goodsDetail','categoryCouponList'];
|
|
|
|
|
|
|
|
|
public function lists()
|
|
|
@@ -38,4 +40,18 @@ class GoodsController extends BaseApiController
|
|
|
$result = GoodsLogic::detail($params['id'],'goods');
|
|
|
return $this->data($result);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //商品优惠卷
|
|
|
+ public function categoryCouponList()
|
|
|
+ {
|
|
|
+ $params = (new UserCouponValidate())->goCheck('category',[
|
|
|
+ 'user_id'=>$this->userId
|
|
|
+ ]);
|
|
|
+ $result = UserCouponLogic::categoryCouponList($params);
|
|
|
+ if (false === $result) {
|
|
|
+ return $this->fail(UserCouponLogic::getError());
|
|
|
+ }
|
|
|
+ return $this->data($result);
|
|
|
+ }
|
|
|
}
|