FarmOrder.php 2.1 KB

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