Browse Source

回调格式修改

master
Lemon 5 years ago
parent
commit
3b32a1569e
  1. 6
      app/Controller/v3/HorsemanController.php
  2. 14
      app/Service/v3/Implementations/HorsemanService.php
  3. 2
      app/Service/v3/Implementations/OrderOnlineService.php

6
app/Controller/v3/HorsemanController.php

@ -24,13 +24,15 @@ class HorsemanController extends BaseController
public function getOrderList() public function getOrderList()
{ {
return $this->success($this->horsemanService->getOrderList());
$orderMainList = $this->horsemanService->getOrderList();
return $this->success(['order_list' => $orderMainList]);
} }
public function getOrderInfo() public function getOrderInfo()
{ {
$globalOrderId = $this->request->input('global_order_id', -1); $globalOrderId = $this->request->input('global_order_id', -1);
return $this->success($this->orderOnlineService->getOrderInfo($globalOrderId));
$orderMain = $this->orderOnlineService->getOrderInfo($globalOrderId);
return $this->success(['order' => $orderMain]);
} }
public function setHorsemanCoordinate() public function setHorsemanCoordinate()

14
app/Service/v3/Implementations/HorsemanService.php

@ -63,8 +63,8 @@ class HorsemanService implements HorsemanServiceInterface
//获取订单信息 //获取订单信息
$order = OrderMain::where('global_order_id',$globalOrderId) $order = OrderMain::where('global_order_id',$globalOrderId)
->select( ->select(
'lat as origi_lat',
'lng as origi_lng',
'lat',
'lng',
'state', 'state',
'market_id' 'market_id'
) )
@ -76,15 +76,13 @@ class HorsemanService implements HorsemanServiceInterface
//获取市场信息 //获取市场信息
$market = Market::where('id',$order->market_id) $market = Market::where('id',$order->market_id)
->select( ->select(
'lat as destination_lat',
'lng as destination_lng'
'lat',
'lng'
) )
->first(); ->first();
$res = [ $res = [
'origi_lat' => $order->origi_lat,
'origi_lng' => $order->origi_lng,
'destination_lat' => $market->destination_lat,
'destination_lng' => $market->destination_lng
'order' => $order,
'market' => $market
]; ];
return $res; return $res;
} }

2
app/Service/v3/Implementations/OrderOnlineService.php

@ -852,6 +852,6 @@ class OrderOnlineService implements OrderOnlineServiceInterface
public function getOrderInfo($globalOrderId) public function getOrderInfo($globalOrderId)
{ {
return OrderMain::query()->where('global_order_id',$globalOrderId)->first();
return OrderMain::query()->where('global_order_id',$globalOrderId)->with('market','orderGoods')->first();
} }
} }
Loading…
Cancel
Save