HealthyOrder.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace app\admin\controller\healthy;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\healthy\HealthyOrderServer;
  5. class HealthyOrder extends BaseController
  6. {
  7. /**
  8. * Notes:获取订单列表
  9. * @return \support\Response
  10. * User: YCP
  11. * Date: 2022/11/8
  12. */
  13. public function getOrderList()
  14. {
  15. [$page, $limit] = $this->getPage();
  16. $keywords = $this->request->get('keywords');
  17. $result = HealthyOrderServer::getOrderList($page, $limit,$keywords);
  18. return json_success($result, '成功');
  19. }
  20. /**
  21. * Notes:订单详情
  22. * @return \support\Response
  23. * User: YCP
  24. * Date: 2022/11/8
  25. */
  26. public function getOrderInfo()
  27. {
  28. $order_id = $this->request->get('order_id');
  29. if(!$order_id){
  30. throw new \Exception('订单ID不能为空');
  31. }
  32. $result = HealthyOrderServer::orderInfo($order_id);
  33. if ($result){
  34. return json_success($result, '获取成功');
  35. }else{
  36. throw new \Exception('获取失败!');
  37. }
  38. }
  39. /**
  40. * Notes:发货
  41. * @return \support\Response
  42. * User: YCP
  43. * Date: 2022/11/9
  44. */
  45. public function orderDelivery()
  46. {
  47. $params = $this->request->post();
  48. $admin_id = $this->request->admin_id;
  49. $result = HealthyOrderServer::orderDelivery($params,$admin_id);
  50. if ($result){
  51. return json_success($result, '获取成功');
  52. }else{
  53. throw new \Exception('获取失败!');
  54. }
  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 = HealthyOrderServer::updatePayStatus($order_id, $order_pay_status);
  70. return json_success($result, '修改成功');
  71. }
  72. }