|
@@ -409,4 +409,28 @@ class Orders extends Api
|
|
|
->paginate(input('limit',15));
|
|
|
$this->success('',$list);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 订单物流查询
|
|
|
+ * @ApiParams (name=id,description=订单ID)
|
|
|
+ */
|
|
|
+ public function logistics_order(){
|
|
|
+ $user=$this->auth->getUser();
|
|
|
+ $data=$this->_validate([
|
|
|
+ 'id'=>['require'],
|
|
|
+ ]);
|
|
|
+ $order=$user->orders()->findOrFail($data['id']);
|
|
|
+ $info=[
|
|
|
+ 'logistics'=>[]
|
|
|
+ ];
|
|
|
+ $logistics=$order->logistics;
|
|
|
+ if(!$logistics){
|
|
|
+ $this->error('未上传物流信息');
|
|
|
+ }
|
|
|
+ $info['logistics']=logistics()
|
|
|
+ ->setNo($logistics['trans_no'])
|
|
|
+ ->setLogistics($logistics->com)
|
|
|
+ ->setPhone($order->address->name)
|
|
|
+ ->query();
|
|
|
+ $this->success('',$info);
|
|
|
+ }
|
|
|
}
|