diff --git a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php index 7358caddf..5768adde5 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -92,7 +92,11 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe $item['top_cate_id'] = $find['top_cate_id']; $item['top_cate_name'] = StoreCategory::where('id', $item['top_cate_id'])->value('name'); if ($item->bhoid) { - $status = PurchaseProductOffer::where('order_id', $item->bhoid)->where('product_id', $item->product_id)->value('status'); + $rawSql = "JSON_CONTAINS(source_order_info, '{\"source_order_id\": {$item->bhoid}}')"; + $status = PurchaseProductOffer::where(['product_id' => $item->product_id])->whereRaw($rawSql)->value('status'); + if (is_null($status)) { + $status = PurchaseProductOffer::where('order_id', $item->bhoid)->where('product_id', $item->product_id)->value('status'); + } if ($status == 1) { $item->status_name = '已完成'; } else {