| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace hd\controllers;
- use biz\shop\classes\ShopCouponClass;
- use biz\shop\services\ShopCouponService;
- use common\components\util;
- use Yii;
- class ShopCouponController extends BaseController
- {
- public $guestAccess = [];
- //门店列表 ssh 2021.5.15
- public function actionList()
- {
- $get = Yii::$app->request->get();
- $where = [];
- $where['shopId'] = $this->shopId;
- $status = $get['status'] ?? 0;
- if (!empty($status)) {
- $where['status'] = $status;
- if ($status == 1) {
- $where['take'] = 1;
- }
- }
- $ghsId = $get['ghsId'] ?? 0;
- if (!empty($ghsId)) {
- $where['ghsId'] = $ghsId;
- }
- $list = ShopCouponService::getCouponList($where);
- util::success($list);
- }
- //有可用红包 ssh 2021.5.15
- public function actionHas()
- {
- //不要考虑最低消费,把客户所有红包列出来,这样客户可以有选择的消费!!!!!!
- $ghsId = Yii::$app->request->get('ghsId', 0);
- $has = ShopCouponClass::hasValidCoupon($this->shopId, $ghsId);
- $data = ['has' => $has];
- util::success($data);
- }
- //供货商发放的有效优惠券、红包 ssh 20211001
- public function actionGhsSendHb()
- {
- $get = Yii::$app->request->get();
- $amount = $get['amount'] ?? 0;
- $ghsId = $get['ghsId'] ?? 0;
- $list = ShopCouponClass::ghsSendHb($this->shopId, $ghsId, $amount);
- util::success(['list' => $list]);
- }
- }
|