截流自动化的商城平台

OrderRenew.php 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. /*
  3. * @Author: xiaohai zmhwork@qq.com
  4. * @Date: 2025-03-14 17:27:51
  5. * @LastEditors: xiaohai zmhwork@qq.com
  6. * @LastEditTime: 2025-03-22 18:10:24
  7. * @FilePath: \opkpm\app\shop\controller\order\OrderRenew.php
  8. * @Description: 续费订单
  9. */
  10. namespace app\shop\controller\order;
  11. use app\common\basics\ShopBase;
  12. use app\common\server\JsonServer;
  13. use app\shop\logic\order\OrderRenewLogic;
  14. use Nette\Utils\Json;
  15. class OrderRenew extends ShopBase
  16. {
  17. public function lists()
  18. {
  19. if ($this->request->isAjax()) {
  20. $get = $this->request->get();
  21. $get['shop_id'] = $this->shop_id;
  22. return JsonServer::success('', OrderRenewLogic::lists($get));
  23. }
  24. //自动取消订单
  25. $shop_id = $this->shop_id;
  26. OrderRenewLogic::cancelOrder($shop_id);
  27. return view('');
  28. }
  29. public function renewLists()
  30. {
  31. if ($this->request->isAjax()) {
  32. $get = $this->request->get();
  33. $get['shop_id'] = $this->shop_id;
  34. return JsonServer::success('', OrderRenewLogic::renewLists($get));
  35. }
  36. return view('');
  37. }
  38. public function renewLog()
  39. {
  40. if ($this->request->isAjax()) {
  41. $get = $this->request->get();
  42. $get['shop_id'] = $this->shop_id;
  43. $get['type_id'] = 1;
  44. return JsonServer::success('', OrderRenewLogic::renewLog($get));
  45. }
  46. return view('');
  47. }
  48. public function renewMonthLog()
  49. {
  50. if ($this->request->isAjax()) {
  51. $get = $this->request->get();
  52. $get['shop_id'] = $this->shop_id;
  53. $get['type_id'] = 2;
  54. return JsonServer::success('', OrderRenewLogic::renewLog($get));
  55. }
  56. return view('');
  57. }
  58. public function buy()
  59. {
  60. $get = $this->request->get();
  61. $get['shop_id'] = $this->shop_id;
  62. $id = $get['id'] ?? 0;
  63. $data = OrderRenewLogic::buy($id);
  64. return view('', ['detail' => $data]);
  65. }
  66. public function add()
  67. {
  68. if ($this->request->isPost()) {
  69. $post = $this->request->post();
  70. $post['shop_id'] = $this->shop_id;
  71. $data = OrderRenewLogic::add($post);
  72. if (!$data) {
  73. return JsonServer::error(OrderRenewLogic::getError());
  74. }
  75. return JsonServer::success('', $data);
  76. }
  77. return JsonServer::error('请求方式错误');
  78. }
  79. public function cancel()
  80. {
  81. if ($this->request->isPost()) {
  82. $post = $this->request->post();
  83. $post['shop_id'] = $this->shop_id;
  84. $data = OrderRenewLogic::cancel($post);
  85. if (!$data) {
  86. return JsonServer::error(OrderRenewLogic::getError());
  87. }
  88. return JsonServer::success('操作成功');
  89. }
  90. return JsonServer::error('请求方式错误');
  91. }
  92. public function payPage()
  93. {
  94. $get = $this->request->get();
  95. $get['shop_id'] = $this->shop_id;
  96. $data = OrderRenewLogic::payPage($get);
  97. if($data[0] === 1){
  98. return JsonServer::error($data[1]);
  99. }
  100. return view('', ['detail' => $data[1]]);
  101. }
  102. public function payWay()
  103. {
  104. if ($this->request->isPost()) {
  105. $post = $this->request->post();
  106. $post['shop_id'] = $this->shop_id;
  107. $data = OrderRenewLogic::payWay($post);
  108. if (!$data) {
  109. return JsonServer::error(OrderRenewLogic::getError());
  110. }
  111. return JsonServer::success('', ['page' => $data]);
  112. }
  113. return JsonServer::error('请求方式错误');
  114. }
  115. }