123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace app\admin\controller\life;
- use app\admin\controller\BaseController;
- use app\admin\server\life\FarmLandOrderServer;
- class FarmLandOrder extends BaseController
- {
- /**
- * Notes:获取订单列表
- * @return \support\Response
- * User: YCP
- * Date: 2022/10/25
- */
- public function getOrderList()
- {
- [$page, $limit] = $this->getPage();
- $keywords = $this->request->get('keywords');
- $result = FarmLandOrderServer::getOrderList($page, $limit,$keywords);
- return json_success($result, '成功');
- }
- /**
- * Notes:订单详情
- * @return \support\Response
- * User: YCP
- * Date: 2022/10/25
- */
- public function getOrderInfo()
- {
- $order_id = $this->request->get('order_id');
- if(!$order_id){
- throw new \Exception('订单ID不能为空');
- }
- $result = FarmLandOrderServer::orderInfo($order_id);
- if ($result){
- return json_success($result, '获取成功');
- }else{
- throw new \Exception('获取失败!');
- }
- }
- /**
- * Notes:下单
- * @return \support\Response
- * User: YCP
- * Date: 2022/10/25
- */
- public function addOrder()
- {
- $params = $this->request->post();
- $user_id = $this->request->user_id;
- $result = FarmLandOrderServer::insertOrder($params, $user_id);
- return json_success($result, '添加成功');
- }
- /**
- * Notes:修改订单支付状态
- * @return \support\Response
- * User: YCP
- * Date: 2022/11/28
- */
- public function updatePayStatus()
- {
- $order_id = $this->request->post('order_id');
- $order_pay_status = $this->request->post('order_pay_status');
- if(!$order_id){
- throw new \Exception('订单ID不能为空');
- }
- $result = FarmLandOrderServer::updatePayStatus($order_id, $order_pay_status);
- return json_success($result, '修改成功');
- }
- }
|