PresellController.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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\logic\marketing\PresellLogic;
  22. use app\adminapi\validate\marketing\PresellValidate;
  23. class PresellController extends BaseAdminController
  24. {
  25. /**
  26. * @notes 预售列表
  27. * @return \think\response\Json
  28. * @author lbzy
  29. * @datetime 2024-04-24 09:10:01
  30. */
  31. function lists()
  32. {
  33. return $this->dataLists();
  34. }
  35. /**
  36. * @notes 预售添加
  37. * @return \think\response\Json
  38. * @author lbzy
  39. * @datetime 2024-04-24 09:15:28
  40. */
  41. function add()
  42. {
  43. $params = (new PresellValidate())->post()->goCheck('add');
  44. $result = PresellLogic::add($params);
  45. if ($result === true) {
  46. return $this->success('添加成功', [],1, 1);
  47. }
  48. return $this->fail(PresellLogic::getError());
  49. }
  50. /**
  51. * @notes 预售编辑
  52. * @return \think\response\Json
  53. * @author lbzy
  54. * @datetime 2024-04-24 14:23:42
  55. */
  56. function edit()
  57. {
  58. $params = (new PresellValidate())->post()->goCheck('edit');
  59. $result = PresellLogic::edit($params);
  60. if ($result === true) {
  61. return $this->success('编辑成功', [],1, 1);
  62. }
  63. return $this->fail(PresellLogic::getError());
  64. }
  65. /**
  66. * @notes 预售详情
  67. * @return \think\response\Json
  68. * @author lbzy
  69. * @datetime 2024-04-24 17:34:22
  70. */
  71. function detail()
  72. {
  73. (new PresellValidate())->goCheck('detail');
  74. return $this->success('成功', PresellLogic::detail(input()));
  75. }
  76. /**
  77. * @notes 开始活动
  78. * @return \think\response\Json
  79. * @author lbzy
  80. * @datetime 2024-04-24 17:38:19
  81. */
  82. function start()
  83. {
  84. $params = (new PresellValidate())->post()->goCheck('detail');
  85. $result = PresellLogic::start($params);
  86. if ($result === true) {
  87. return $this->success('开始成功', [], 1, 1);
  88. }
  89. return $this->fail(PresellLogic::getError());
  90. }
  91. /**
  92. * @notes 结束活动
  93. * @return \think\response\Json
  94. * @author lbzy
  95. * @datetime 2024-04-24 17:44:56
  96. */
  97. function end()
  98. {
  99. $params = (new PresellValidate())->post()->goCheck('detail');
  100. $result = PresellLogic::end($params);
  101. if ($result === true) {
  102. return $this->success('结束成功', [], 1, 1);
  103. }
  104. return $this->fail(PresellLogic::getError());
  105. }
  106. /**
  107. * @notes 删除活动
  108. * @return \think\response\Json
  109. * @author lbzy
  110. * @datetime 2024-04-24 17:47:02
  111. */
  112. function delete()
  113. {
  114. $params = (new PresellValidate())->post()->goCheck('detail');
  115. $result = PresellLogic::delete($params);
  116. if ($result === true) {
  117. return $this->success('删除成功', [], 1, 1);
  118. }
  119. return $this->fail(PresellLogic::getError());
  120. }
  121. }