From cc197c601cff9a5be77be24c20c8d304130d787d Mon Sep 17 00:00:00 2001 From: yanzai Date: Mon, 14 Oct 2024 14:55:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=80=89=E5=AE=9A=E7=9A=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AD=9B=E9=80=89=E5=A5=97=E9=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/Http/Controllers/API/H5/ComboController.php | 13 +++++++++++++ h5/pages/main/index/index.vue | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index 021a23e..016e034 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -97,6 +97,19 @@ class ComboController extends Controller } } + if(isset($combo_item)){ + $combo_ids=DB::table('combo_items')->whereIn('item_id',$combo_item)->where(['status'=>1]) + ->groupBy('combo_id') + ->havingRaw('COUNT(DISTINCT item_id) = '.count($combo_item)) + ->pluck('combo_id')->toArray(); + $count = count($combo_ids); + $placeholders = implode(', ', array_fill(0, $count, '?')); + + $sql = $sql . " and a.combo_id in ($placeholders) "; + + $canshu =array_merge($canshu, $combo_ids); + + } diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue index f23e395..09dab1f 100644 --- a/h5/pages/main/index/index.vue +++ b/h5/pages/main/index/index.vue @@ -261,7 +261,7 @@ - 10112145 + 10131106