ActivityCutPriceController.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\admin\controllers;
  8. use app\models\Goods;
  9. use app\models\Option;
  10. use app\constants\OptionSetting;
  11. use app\modules\admin\models\ActivityCutPriceForm;
  12. class ActivityCutPriceController extends BaseController
  13. {
  14. /**
  15. * @return \yii\web\Response
  16. * 获取列表
  17. */
  18. public function actionList()
  19. {
  20. $form = new ActivityCutPriceForm();
  21. $form->attributes = get_params();
  22. $res = $form->search();
  23. return $this->asJson($res);
  24. }
  25. public function actionListSelect()
  26. {
  27. $form = new ActivityCutPriceForm();
  28. $form->attributes = get_params();
  29. $res = $form->listSelect();
  30. return $this->asJson($res);
  31. }
  32. /**
  33. * @return \yii\web\Response
  34. * 保存信息
  35. */
  36. public function actionSave()
  37. {
  38. $form = new ActivityCutPriceForm();
  39. $form->attributes = post_params();
  40. $res = $form->save();
  41. return $this->asJson($res);
  42. }
  43. /**
  44. * @return \yii\web\Response
  45. * 获取信息
  46. */
  47. public function actionGetInfo()
  48. {
  49. $form = new ActivityCutPriceForm();
  50. $form->attributes = get_params();
  51. $res = $form->getInfo();
  52. return $this->asJson($res);
  53. }
  54. /**
  55. * @return \yii\web\Response
  56. * 修改状态
  57. */
  58. public function actionDel()
  59. {
  60. $form = new ActivityCutPriceForm();
  61. $form->attributes = post_params();
  62. $form->store_id = get_store_id();
  63. $res = $form->del();
  64. return $this->asJson($res);
  65. }
  66. public function actionCatList()
  67. {
  68. $form = new ActivityCutPriceForm();
  69. $form->name = get_params('name');
  70. $form->status = get_params('status', -1);
  71. $form->store_id = get_store_id();
  72. $res = $form->catList();
  73. return $this->asJson($res);
  74. }
  75. public function actionCatInfo()
  76. {
  77. $form = new ActivityCutPriceForm();
  78. $id = get_params('id', 0);
  79. $res = $form->catInfo($id);
  80. return $this->asJson($res);
  81. }
  82. public function actionCatSave()
  83. {
  84. $form = new ActivityCutPriceForm();
  85. $id = post_params('id', 0);
  86. $name = post_params('name', '');
  87. $pic_url = post_params('pic_url', '');
  88. $sort = post_params('sort', 1000);
  89. $is_show = post_params('is_show', 1);
  90. $form->store_id = get_store_id();
  91. $res = $form->catSave($id, $name, $pic_url, $sort, $is_show);
  92. return $this->asJson($res);
  93. }
  94. public function actionCatStatus()
  95. {
  96. $form = new ActivityCutPriceForm();
  97. $form->ids = post_params('ids', 0);
  98. $form->status = post_params('status', 1);
  99. $form->store_id = get_store_id();
  100. $res = $form->catStatus();
  101. return $this->asJson($res);
  102. }
  103. public function actionBannerList()
  104. {
  105. $form = new ActivityCutPriceForm();
  106. $form->name = get_params('name');
  107. $form->activity_id = get_params('activity_id');
  108. $form->store_id = get_store_id();
  109. $res = $form->bannerList();
  110. return $this->asJson($res);
  111. }
  112. public function actionBannerSave()
  113. {
  114. $form = new ActivityCutPriceForm();
  115. $id = post_params('id', 0);
  116. $activity_id = post_params('activity_id', 0);
  117. $name = post_params('name', '');
  118. $pic_url = post_params('pic_url', '');
  119. $url = post_params('url', '');
  120. $sort = post_params('sort', 1000);
  121. $form->store_id = get_store_id();
  122. $res = $form->bannerSave($id, $activity_id, $name, $pic_url, $url, $sort);
  123. return $this->asJson($res);
  124. }
  125. public function actionBannerDel()
  126. {
  127. $form = new ActivityCutPriceForm();
  128. $form->ids = post_params('ids', 0);
  129. $form->store_id = get_store_id();
  130. $res = $form->bannerDel();
  131. return $this->asJson($res);
  132. }
  133. public function actionConf(){
  134. $form = new ActivityCutPriceForm();
  135. $form->store_id = get_store_id();
  136. $res = $form->conf();
  137. return $this->asJson($res);
  138. }
  139. public function actionConfSave(){
  140. $conf = input_params('conf');
  141. $form = new ActivityCutPriceForm();
  142. $form->store_id = get_store_id();
  143. $res = $form->confSave($conf);
  144. return $this->asJson($res);
  145. }
  146. public function actionOrderList()
  147. {
  148. $form = new ActivityCutPriceForm();
  149. $form->attributes = get_params();
  150. $form->status = get_params('status', -1);
  151. $form->goods_name = get_params('goods_name');
  152. $form->activity_id = get_params('activity_id');
  153. $form->store_id = get_store_id();
  154. $res = $form->orderList();
  155. return $this->asJson($res);
  156. }
  157. public function actionOrderDel()
  158. {
  159. $form = new ActivityCutPriceForm();
  160. $form->ids = post_params('ids', 0);
  161. $form->store_id = get_store_id();
  162. $res = $form->orderDel();
  163. return $this->asJson($res);
  164. }
  165. /**
  166. * 联盟审核列表
  167. */
  168. public function actionGetAuditList() {
  169. $form = new ActivityCutPriceForm();
  170. $form->attributes = get_params();
  171. $res = $form->auditList();
  172. return $this->asJson($res);
  173. }
  174. /**
  175. * 活动审核状态修改
  176. */
  177. public function actionAuditHandle() {
  178. $form = new ActivityCutPriceForm();
  179. $form->attributes = post_params();
  180. $res = $form->auditHandle();
  181. return $this->asJson($res);
  182. }
  183. }