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

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

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

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

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

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