diff --git a/app/api/controller/Order.php b/app/api/controller/Order.php index eab9b6bf..49a22b89 100644 --- a/app/api/controller/Order.php +++ b/app/api/controller/Order.php @@ -109,10 +109,15 @@ class Order extends Controller } $transferRecordService = new TransferRecord(); $data = $transferRecordService->getExpressByExpressNo($expressNo); - $express['items'] = $data['traces']; - $express['express_name'] = $data['express']['express_name']; - $express['express_no'] = $data['express_no']; - return $this->renderSuccess($express); + $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('暂无物流信息'); + } /** * 获取物流跟踪信息 @@ -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); diff --git a/app/api/controller/User.php b/app/api/controller/User.php index 712777c6..2cc77400 100644 --- a/app/api/controller/User.php +++ b/app/api/controller/User.php @@ -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'); } diff --git a/app/api/model/Agreement.php b/app/api/model/Agreement.php index f518c1c3..6da690db 100644 --- a/app/api/model/Agreement.php +++ b/app/api/model/Agreement.php @@ -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(); } diff --git a/app/api/service/TransferRecord.php b/app/api/service/TransferRecord.php index e92f541a..66c322d1 100644 --- a/app/api/service/TransferRecord.php +++ b/app/api/service/TransferRecord.php @@ -109,12 +109,15 @@ class TransferRecord extends BaseService $expressService = new ExpressService(); $transferRecord = \app\common\model\TransferRecord::getList($expressNo); //物流追踪 - $transferRecord['traces'] = $expressService->traces( - $transferRecord->express, - $expressNo, - $transferRecord['receiver_phone'], - $this::getStoreId() - ); + if (!empty($transferRecord->express)) { + $transferRecord['traces'] = $expressService->traces( + $transferRecord->express, + $expressNo, + $transferRecord['receiver_phone'], + $this::getStoreId() + ); + } + return $transferRecord; } } \ No newline at end of file