物流信息查询兼容和协议报错

pull/1/head
ztt 11 months ago
parent e79795b436
commit 7b5feda868
  1. 61
      app/api/controller/Order.php
  2. 2
      app/api/controller/User.php
  3. 2
      app/api/model/Agreement.php
  4. 15
      app/api/service/TransferRecord.php

@ -109,10 +109,15 @@ class Order extends Controller
} }
$transferRecordService = new TransferRecord(); $transferRecordService = new TransferRecord();
$data = $transferRecordService->getExpressByExpressNo($expressNo); $data = $transferRecordService->getExpressByExpressNo($expressNo);
$express['items'] = $data['traces']; $express = [];
$express['express_name'] = $data['express']['express_name']; if ($data['traces']) {
$express['express_no'] = $data['express_no']; $express['items'] = $data['traces'];
return $this->renderSuccess($express); $express['express_name'] = $data['express']['express_name'];
$express['express_no'] = $data['express_no'];
return $this->renderSuccess($express);
}
return $this->renderError('暂无物流信息');
} }
/** /**
* 获取物流跟踪信息 * 获取物流跟踪信息
@ -166,17 +171,17 @@ class Order extends Controller
*/ */
public function actionCounts(): Json public function actionCounts(): Json
{ {
// $model = new OrderModel; // $model = new OrderModel;
// $counts = $model->getTodoCounts(); // $counts = $model->getTodoCounts();
$data = [ $data = [
'reservation_number' => 1, 'reservation_number' => 1,//预约记录
'view_number' => 0, 'view_number' => 2,//浏览记录
'send_number' => 0, 'send_number' => 0,//发货数量
'integral_number' => 0, 'integral_number' => 0,//积分数量
'coupon_number' => 0, 'coupon_number' => 0,//优惠券
'goods_collect_number' => 0, 'goods_collect_number' => 0,//收藏商品数量
'cart_number' => 0, 'cart_number' => 0,//购物车数量
'take_goods_number' => 1, 'take_goods_number' => 1,//发货记录&提货记录
]; ];
return $this->renderSuccess($data); return $this->renderSuccess($data);
} }
@ -191,23 +196,23 @@ class Order extends Controller
// $counts = $model->getTodoCounts(); // $counts = $model->getTodoCounts();
$data = [ $data = [
'goods_order' => [ 'goods_order' => [
'payment_number' => 0, 'payment_number' => 0,//待付款
'delivery_number' => 0, 'delivery_number' => 0,//待发货
'received_number' => 0, 'received_number' => 0,//待收货
'finish_number' => 0, 'finish_number' => 0,//已完成
], ],
'service_order' => [ 'service_order' => [
'confirm_number' => 0, 'confirm_number' => 0,//待确认
'service_number' => 0, 'service_number' => 0,//待服务
'payment_number' => 0, 'payment_number' => 0,//待支付
'check_number' => 0, 'check_number' => 0,//已完成
], ],
'distribution_order' => [ 'distribution_order' => [//分销订单
'payment_number' => 0, 'payment_number' => 0,//待付款
'delivery_number' => 0, 'delivery_number' => 0,//待发货
'received_number' => 0, 'received_number' => 0,//待收货
'finish_number' => 0, 'finish_number' => 0,//已完成
'retund_number' => 0, 'retund_number' => 0,//退款中
], ],
]; ];
return $this->renderSuccess($data); return $this->renderSuccess($data);

@ -277,7 +277,7 @@ class User extends Controller
if (empty($params['type'])) { if (empty($params['type'])) {
return $this->renderSuccess("参数错误"); return $this->renderSuccess("参数错误");
} }
$detail = $model->detail($params); $detail = $model->detail2($params);
return $this->renderSuccess(compact('detail'), 'success'); return $this->renderSuccess(compact('detail'), 'success');
} }

@ -41,7 +41,7 @@ class Agreement extends AgreementModel
* @param $params * @param $params
* @return Agreement|array|null * @return Agreement|array|null
*/ */
public function detail($params) { public function detail2($params) {
return self::where('type', $params['type'])->find(); return self::where('type', $params['type'])->find();
} }

@ -109,12 +109,15 @@ class TransferRecord extends BaseService
$expressService = new ExpressService(); $expressService = new ExpressService();
$transferRecord = \app\common\model\TransferRecord::getList($expressNo); $transferRecord = \app\common\model\TransferRecord::getList($expressNo);
//物流追踪 //物流追踪
$transferRecord['traces'] = $expressService->traces( if (!empty($transferRecord->express)) {
$transferRecord->express, $transferRecord['traces'] = $expressService->traces(
$expressNo, $transferRecord->express,
$transferRecord['receiver_phone'], $expressNo,
$this::getStoreId() $transferRecord['receiver_phone'],
); $this::getStoreId()
);
}
return $transferRecord; return $transferRecord;
} }
} }
Loading…
Cancel
Save