FoodOrder.php 1.5 KB

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