PackageOrder.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace app\admin\controller\life;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\life\PackageOrderServer;
  5. class PackageOrder extends BaseController
  6. {
  7. /**
  8. * Notes:获取订单列表
  9. * @return \support\Response
  10. * User: YCP
  11. * Date: 2022/10/19
  12. */
  13. public function getOrderList()
  14. {
  15. [$page, $limit] = $this->getPage();
  16. $keywords = $this->request->get('keywords');
  17. $order_package_type = $this->request->get('order_package_type');
  18. $result = PackageOrderServer::getOrderList($page, $limit,$keywords,$order_package_type);
  19. return json_success($result, '成功');
  20. }
  21. /**
  22. * Notes:订单详情
  23. * @return \support\Response
  24. * User: YCP
  25. * Date: 2022/10/19
  26. */
  27. public function getOrderInfo()
  28. {
  29. $order_id = $this->request->get('order_id');
  30. if(!$order_id){
  31. throw new \Exception('订单ID不能为空');
  32. }
  33. $result = PackageOrderServer::orderInfo($order_id);
  34. if ($result){
  35. return json_success($result, '获取成功');
  36. }else{
  37. throw new \Exception('获取失败!');
  38. }
  39. }
  40. /**
  41. * Notes:修改订单完成状态
  42. * @return \support\Response
  43. * User: YCP
  44. * Date: 2022/10/19
  45. */
  46. public function updateFinish()
  47. {
  48. $order_id = $this->request->get('order_id');
  49. $order_finish = $this->request->get('order_finish');
  50. if(!$order_id){
  51. throw new \Exception('订单ID不能为空');
  52. }
  53. $result = PackageOrderServer::updateFinish($order_id, $order_finish);
  54. return json_success($result, '修改成功');
  55. }
  56. /**
  57. * Notes:修改订单支付状态
  58. * @return \support\Response
  59. * User: YCP
  60. * Date: 2022/11/28
  61. */
  62. public function updatePayStatus()
  63. {
  64. $order_id = $this->request->post('order_id');
  65. $order_pay_status = $this->request->post('order_pay_status');
  66. if(!$order_id){
  67. throw new \Exception('订单ID不能为空');
  68. }
  69. $result = PackageOrderServer::updatePayStatus($order_id, $order_pay_status);
  70. return json_success($result, '修改成功');
  71. }
  72. }