VoucherController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\client\controllers\v1\alipay;
  8. use app\modules\client\models\v1\alipay\AuthForm;
  9. use yii\base\BaseObject;
  10. use app\models\Option;
  11. use app\constants\OptionSetting;
  12. use app\modules\admin\models\alipay\Voucher;
  13. use app\modules\admin\models\CouponForm;
  14. use \app\models\AlipayAcitvityVoucherOrder;
  15. class VoucherController extends BaseController
  16. {
  17. public function actionIndex() {
  18. $form = new Voucher();
  19. $form->mini_id = get_mini_id();
  20. $form->store_id = get_store_id();
  21. $form->page = post_params('page', 1);
  22. $userId = get_user()->alipay_open_id;
  23. $res = $form->listCanSendByUser($userId);
  24. return $this->asJson($res);
  25. }
  26. public function actionClerk() {
  27. $form = new \app\modules\admin\models\alipay\Ordervoucher();
  28. $form->mini_id = get_mini_id();
  29. $form->store_id = get_store_id();
  30. $form->user_id = get_user_id();
  31. $total_price = post_params('total_price', 100);
  32. $ov = post_params('ov', '');
  33. $submit = post_params('submit', 1);
  34. $res = $form->use($submit, $ov, $total_price);
  35. return $this->asJson($res);
  36. }
  37. }