截流自动化的商城平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. namespace app\admin\controller\team;
  3. use app\common\basics\AdminBase;
  4. use app\common\server\JsonServer;
  5. use app\admin\logic\team\ActivityLogic;
  6. use think\facade\View;
  7. class Activity extends AdminBase
  8. {
  9. /**
  10. * @Notes: 拼团商品
  11. * @Author: 张无忌
  12. */
  13. public function lists()
  14. {
  15. if ($this->request->isAjax()) {
  16. $get = $this->request->get();
  17. $lists = ActivityLogic::lists($get);
  18. return JsonServer::success('获取成功', $lists);
  19. }
  20. View::assign('statistics', ActivityLogic::statistics());
  21. return view();
  22. }
  23. /**
  24. * @notes 拼团商品的开团记录
  25. * @author 张无忌
  26. * @date 2021/7/19 11:00
  27. */
  28. public function record()
  29. {
  30. if ($this->request->isAjax()) {
  31. $get = $this->request->get();
  32. $lists = ActivityLogic::record($get);
  33. return JsonServer::success('获取成功', $lists);
  34. }
  35. $get = $this->request->get();
  36. View::assign('shop_id', $get['shop_id']);
  37. View::assign('team_activity_id', $get['id']);
  38. View::assign('recordStatistics', ActivityLogic::recordStatistics($get));
  39. return view();
  40. }
  41. /**
  42. * @Notes: 统计
  43. * @Author: 张无忌
  44. */
  45. public function statistics()
  46. {
  47. if ($this->request->isAjax()) {
  48. $detail = ActivityLogic::statistics();
  49. return JsonServer::success('获取成功', $detail);
  50. }
  51. return JsonServer::error('异常');
  52. }
  53. /**
  54. * @Notes: 审核
  55. * @Author: 张无忌
  56. */
  57. public function audit()
  58. {
  59. if ($this->request->isAjax()) {
  60. $post = $this->request->post();
  61. $res = ActivityLogic::audit($post);
  62. if ($res === false) {
  63. $message = ActivityLogic::getError() ?: '审核失败';
  64. return JsonServer::error($message);
  65. }
  66. return JsonServer::success('审核成功');
  67. }
  68. return view();
  69. }
  70. /**
  71. * @Notes: 违规重审
  72. * @Author: 张无忌
  73. */
  74. public function violation()
  75. {
  76. if ($this->request->isAjax()) {
  77. $id = $this->request->post('id');
  78. $res = ActivityLogic::violation($id);
  79. if ($res === false) {
  80. $message = ActivityLogic::getError() ?: '操作失败';
  81. return JsonServer::error($message);
  82. }
  83. return JsonServer::success('操作成功');
  84. }
  85. return JsonServer::error("异常");
  86. }
  87. /**
  88. * @Notes: 拼团信息
  89. * @Author: 张无忌
  90. * @return \think\response\View
  91. */
  92. public function details()
  93. {
  94. $id = $this->request->get('id');
  95. View::assign('detail', ActivityLogic::detail($id));
  96. return view();
  97. }
  98. }