TeamController.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\controller\marketing;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\marketing\TeamLists;
  22. use app\adminapi\lists\marketing\TeamRecordLists;
  23. use app\adminapi\logic\marketing\TeamLogic;
  24. use app\adminapi\validate\marketing\TeamValidate;
  25. class TeamController extends BaseAdminController
  26. {
  27. /**
  28. * @notes 拼团活动列表
  29. * @author 张无忌
  30. * @date 2021/8/2 11:54
  31. */
  32. public function lists()
  33. {
  34. return $this->dataLists((new TeamLists()));
  35. }
  36. /**
  37. * @notes 拼团概况
  38. * @author 张无忌
  39. * @date 2021/8/2 19:09
  40. */
  41. public function survey()
  42. {
  43. $result = TeamLogic::survey();
  44. return $this->success('获取成功', $result);
  45. }
  46. /**
  47. * @notes 拼团详细信息
  48. * @author 张无忌
  49. * @date 2021/8/2 19:10
  50. */
  51. public function detail()
  52. {
  53. $params = (new TeamValidate())->goCheck('id');
  54. $result = TeamLogic::detail($params);
  55. return $this->success('获取成功', $result);
  56. }
  57. /**
  58. * @notes 拼团数据信息
  59. * @author 张无忌
  60. * @date 2021/8/2 19:10
  61. */
  62. public function info()
  63. {
  64. $params = (new TeamValidate())->goCheck('id');
  65. $result = TeamLogic::info($params);
  66. return $this->success('获取成功', $result);
  67. }
  68. /**
  69. * @notes 新增拼团活动
  70. * @author 张无忌
  71. * @date 2021/8/2 11:54
  72. */
  73. public function add()
  74. {
  75. $params = (new TeamValidate())->post()->goCheck('add');
  76. $result = TeamLogic::add($params);
  77. if ($result === true) {
  78. return $this->success('添加成功');
  79. }
  80. return $this->fail($result);
  81. }
  82. /**
  83. * @notes 编辑拼团活动
  84. * @author 张无忌
  85. * @date 2021/8/2 11:54
  86. */
  87. public function edit()
  88. {
  89. $params = (new TeamValidate())->post()->goCheck();
  90. $result = TeamLogic::edit($params);
  91. if ($result === true) {
  92. return $this->success('编辑成功');
  93. }
  94. return $this->fail($result);
  95. }
  96. /**
  97. * @notes 删除拼团活动
  98. * @author 张无忌
  99. * @date 2021/8/2 11:55
  100. */
  101. public function delete()
  102. {
  103. $params = (new TeamValidate())->post()->goCheck('id');
  104. $result = TeamLogic::delete($params);
  105. if ($result === true) {
  106. return $this->success('删除成功');
  107. }
  108. return $this->fail($result);
  109. }
  110. /**
  111. * @notes 启动拼团活动
  112. * @author 张无忌
  113. * @date 2021/8/2 20:43
  114. */
  115. public function open()
  116. {
  117. $params = (new TeamValidate())->post()->goCheck('id');
  118. TeamLogic::open($params);
  119. return $this->success('启动成功');
  120. }
  121. /**
  122. * @notes 停止拼团活动
  123. * @author 张无忌
  124. * @date 2021/8/2 20:43
  125. */
  126. public function stop()
  127. {
  128. $params = (new TeamValidate())->post()->goCheck('id');
  129. $result = TeamLogic::stop($params);
  130. if ($result === true) {
  131. return $this->success('结束成功');
  132. }
  133. return $this->fail($result);
  134. }
  135. /**
  136. * @notes 拼团记录
  137. * @author suny
  138. * @date 2021/9/23 3:29 下午
  139. */
  140. public function record()
  141. {
  142. return $this->dataLists(new TeamRecordLists());
  143. }
  144. /**
  145. * @notes 结束拼团记录
  146. * @author suny
  147. * @date 2021/9/30 11:30 上午
  148. */
  149. public function cancel()
  150. {
  151. $params = (new TeamValidate())->post()->goCheck('id');
  152. TeamLogic::cancel($params);
  153. return $this->success('结束成功');
  154. }
  155. }