ShopCouponController.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. //门店列表 ssh 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. if ($status == 1) {
  20. $where['take'] = 1;
  21. }
  22. }
  23. $ghsId = $get['ghsId'] ?? 0;
  24. if (!empty($ghsId)) {
  25. $where['ghsId'] = $ghsId;
  26. }
  27. $list = ShopCouponService::getCouponList($where);
  28. util::success($list);
  29. }
  30. //有可用红包 ssh 2021.5.15
  31. public function actionHas()
  32. {
  33. $data = ['has' => 0];
  34. util::success($data);
  35. }
  36. //供货商发放的有效优惠券、红包 ssh 20211001
  37. public function actionGhsSendHb()
  38. {
  39. $get = Yii::$app->request->get();
  40. $amount = $get['amount'] ?? 0;
  41. $ghsId = $get['ghsId'] ?? 0;
  42. $list = ShopCouponClass::ghsSendHb($this->shopId, $ghsId, $amount);
  43. util::success(['list' => $list]);
  44. }
  45. }