BookCourseOrder.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace app\admin\controller\life;
  3. use app\admin\controller\BaseController;
  4. use app\admin\model\BookCourse;
  5. use app\admin\server\goods\GoodsServer;
  6. use app\admin\server\life\BookCourseOrderServer;
  7. use app\admin\server\medical\MedicalCareOrderServer;
  8. class BookCourseOrder extends BaseController
  9. {
  10. /**
  11. * Notes:订单列表
  12. * @return \support\Response
  13. * User: ZQ
  14. * Date: 2022/10/14
  15. */
  16. public function getOrderList()
  17. {
  18. [$page, $limit] = $this->getPage();
  19. $keywords = $this->request->get('keywords');//订单号
  20. $result = BookCourseOrderServer::getOrderList($page, $limit, $keywords);
  21. return json_success($result, '成功');
  22. }
  23. /**
  24. * Notes:订单详情
  25. * @return \support\Response
  26. * User: QJF
  27. * Date: 2022/10/14
  28. */
  29. public function getOrderInfo()
  30. {
  31. $order_id = $this->request->get('order_id');
  32. $result = BookCourseOrderServer::getOrderInfo($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: ZQ
  43. * Date: 2022/10/14
  44. */
  45. public function delOrder()
  46. {
  47. $order_id = $this->request->get('order_id');
  48. $result = BookCourseOrderServer::delOrder($order_id);
  49. if ($result){
  50. return json_success($result, '删除成功');
  51. }else{
  52. throw new \Exception('删除失败!');
  53. }
  54. }
  55. /**
  56. * Notes:修改订单支付状态
  57. * @return \support\Response
  58. * User: YCP
  59. * Date: 2022/11/28
  60. */
  61. public function updatePayStatus()
  62. {
  63. $order_id = $this->request->post('order_id');
  64. $order_status = $this->request->post('order_status');
  65. if(!$order_id){
  66. throw new \Exception('订单ID不能为空');
  67. }
  68. $result = BookCourseOrderServer::updatePayStatus($order_id, $order_status);
  69. return json_success($result, '修改成功');
  70. }
  71. }