HomeOrder.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\admin\controller\home;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\home\HomeOrderServer;
  5. class HomeOrder extends BaseController
  6. {
  7. /**
  8. * Notes:获取订单列表
  9. * @return \support\Response
  10. * User: YCP
  11. * Date: 2022/11/2
  12. */
  13. public function getOrderList()
  14. {
  15. [$page, $limit] = $this->getPage();
  16. $keywords = $this->request->get('keywords');
  17. $result = HomeOrderServer::getOrderList($page, $limit,$keywords);
  18. return json_success($result, '成功');
  19. }
  20. /**
  21. * Notes:订单详情
  22. * @return \support\Response
  23. * User: YCP
  24. * Date: 2022/11/2
  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 = HomeOrderServer::orderInfo($order_id);
  33. if ($result){
  34. return json_success($result, '获取成功');
  35. }else{
  36. throw new \Exception('获取失败!');
  37. }
  38. }
  39. }