CouponController.php 921 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * CouponController.php
  4. * todo 文件描述
  5. * Created on 2024/12/4 下午2:24
  6. * @author: hankaige
  7. */
  8. namespace app\modules\client\controllers\v1\cashier;
  9. use app\modules\client\models\v1\cashier\CouponFrom;
  10. class CouponController extends BaseController
  11. {
  12. public function actionGetCouponList(): \yii\web\response
  13. {
  14. $form = new CouponFrom();
  15. $form->store_id = $this->store_id;
  16. $form->scenario = $form::COUPON_LIST;
  17. $form->attributes = get_params();
  18. return $this->asJson($form->couponList());
  19. }
  20. public function actionSendCoupon(): \yii\web\response
  21. {
  22. $form = new CouponFrom();
  23. $form->store_id = $this->store_id;
  24. $form->md_id = $this->md_id;
  25. $form->scenario = $form::COUPON_SEND;
  26. $form->attributes = post_params();
  27. return $this->asJson($form->sendCoupon());
  28. }
  29. }