ShopCouponController.php 861 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace hd\controllers;
  3. use biz\shop\classes\ShopCouponClass;
  4. use biz\shop\services\ShopCouponService;
  5. use common\components\util;
  6. use Yii;
  7. class ShopCouponController extends BaseController
  8. {
  9. public $guestAccess = [];
  10. //门店列表 shish 2021.5.15
  11. public function actionList()
  12. {
  13. $get = Yii::$app->request->get();
  14. $where = [];
  15. $where['shopId'] = $this->shopId;
  16. $status = $get['status'] ?? 0;
  17. if (!empty($status)) {
  18. $where['status'] = $status;
  19. }
  20. $list = ShopCouponService::getCouponList($where);
  21. util::success($list);
  22. }
  23. //有可用红包 shish 2021.5.15
  24. public function actionHas()
  25. {
  26. $has = ShopCouponClass::hasUnUseCoupon($this->shopId);
  27. $data = [
  28. 'has' => $has
  29. ];
  30. util::success($data);
  31. }
  32. }