订单者查询不出快递信息或查询报错如下:
解决方法 :
1、修改app\common\repositories\store\order\StoreOrderRepository.php直接替换方法即可
public function express(int $orderId,? int $merId)
{
$order = $this->dao->get($orderId);
if ($merId && $order['mer_id'] != $merId) throw new ValidateException('订单信息不存在');
if (!in_array($order['delivery_type'],[1,4])) throw new ValidateException('订单状态错误');
return ExpressService::express($order->delivery_id, $order->delivery_name, $order->user_phone);
}
2、修改app\controller\admin\order\Order.php 这里的参数传入,或者直接替换整个方法
public function express($id)
{
if (!$this->repository->getWhereCount(['order_id' => $id, 'delivery_type' => 1]))
return app('json')->fail('订单信息或状态错误');
return app('json')->success($this->repository->express($id,null));
}
3、修改移动端app\controller\api\store\order\StoreOrder.php,替换整个方法
public function express($id)
{
$order = $this->repository->getWhere(['order_id' => $id, 'is_del' => 0]);
if (!$order)
return app('json')->fail('订单不存在');
if (!$order->delivery_type || !$order->delivery_id)
return app('json')->fail('订单未发货');
$express = $this->repository->express($id,null);
$order->append(['orderProduct']);
return app('json')->success(compact('express', 'order'));
}
4、删除crmeb\services\ExpressService.php部分验证代码
5、修改退款查询快递部分 app\common\repositories\store\order\StoreRefundOrderRepository.php,替换整个方法
public function express($ordertId)
{
$refundOrder = $this->dao->get($ordertId);
return ExpressService::express($refundOrder->delivery_id, $refundOrder->delivery_name, $refundOrder->delivery_phone);
}
然后重启一下swoole服务
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}