huangsijun
2025-11-06 25a3e9bb63fe83f7c82180a7d373a331b2f41acb
admin/app/api/model/order/Order.php
@@ -342,7 +342,11 @@
    public static function getUserOrderDetail($order_id, $user_id)
    {
        $model = new static();
        $order = $model->where(['order_id' => $order_id, 'user_id' => $user_id])->with(['product' => ['image', 'refund'], 'address', 'express', 'extractStore','extractClerk', 'supplier', 'advance'])->find();
        $where = ['order_id' => $order_id, 'user_id' => $user_id];
        if(strlen($order_id)>=14){
            $where = ['order_no' => $order_id, 'user_id' => $user_id];
        }
        $order = $model->where($where)->with(['product' => ['image', 'refund'], 'address', 'express', 'extractStore','extractClerk', 'supplier', 'advance'])->find();
        if (empty($order)) {
            throw new BaseException(['msg' => '订单不存在']);
        }