VerifyController.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\alliance\controllers;
  8. use app\modules\alliance\controllers\BaseController;
  9. use app\modules\alliance\models\VerifyIndexForm;
  10. class VerifyController extends BaseController
  11. {
  12. /**
  13. * 卡券领取
  14. */
  15. public function actionReceive() {
  16. $form = new VerifyIndexForm();
  17. $form->attributes = get_params();
  18. $form->verify_card_id = get_params('id');
  19. return $this->asJson($form->receive());
  20. }
  21. /**
  22. * 我的核销卡列表
  23. */
  24. public function actionIndex()
  25. {
  26. /**
  27. * 有效卡数量
  28. * 核销卡id
  29. * 核销卡名称
  30. * 剩余次数
  31. * 有效期
  32. */
  33. $form = new VerifyIndexForm();
  34. $form->attributes = get_params();
  35. $form->store_id = get_store_id();
  36. $form->user_id = 0;
  37. $form->saas_id = get_saas_user_id();
  38. return $this->asJson($form->search());
  39. }
  40. /**
  41. * 核销卡使用记录页
  42. */
  43. public function actionVerifyLog(){
  44. $form = new VerifyIndexForm();
  45. $form->attributes = get_params();
  46. $form->store_id = get_store_id();
  47. $form->user_id = 0;
  48. $form->saas_id = get_saas_user_id();
  49. return $this->asJson($form->log());
  50. }
  51. /**
  52. * 核销卡详情页
  53. */
  54. public function actionVerifyDetail(){
  55. $form = new VerifyIndexForm();
  56. $form->attributes = get_params();
  57. $form->store_id = get_store_id();
  58. $form->user_id = 0;
  59. $form->saas_id = get_saas_user_id();
  60. $form->sale_id = get_params('sale_id');
  61. return $this->asJson($form->detail());
  62. }
  63. /**
  64. * 删除个人卡券
  65. */
  66. public function actionDel() {
  67. $form = new VerifyIndexForm();
  68. $form->attributes = get_params();
  69. $form->store_id = get_store_id();
  70. $form->user_id = 0;
  71. $form->saas_id = get_saas_user_id();
  72. $form->id = get_params('id');
  73. return $this->asJson($form->delVerifyCard());
  74. }
  75. /**
  76. * 获取核销记录
  77. */
  78. public function actionVerifyMdLog()
  79. {
  80. $form = new VerifyIndexForm();
  81. $form->attributes = get_params();
  82. $form->store_id = get_store_id();
  83. $form->user_id = get_user_id();
  84. $form->sale_id =get_params('sale_id');
  85. return $this->asJson($form->getVerifyLog());
  86. }
  87. }