From 746b753c7664def69d286cb98c7e2c2bee1f0c17 Mon Sep 17 00:00:00 2001 From: yanzai Date: Tue, 8 Oct 2024 08:10:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=20=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E5=A5=97=E9=A4=90bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/Http/Controllers/API/H5/ComboController.php | 10 ++++++++-- h5/pages/main/index/index.vue | 2 +- h5/pages/main/tj/tjzx.vue | 6 ++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index e91efd0..dce4c51 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -403,7 +403,6 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4) // 用于存储每个数组及其与目标数组的相似度 $similarities = []; foreach ($combo_temp as $index => $array) { - $similarity = $this->jaccard_similarity($item_ids, $array); $similarities[$index] = $similarity; } @@ -422,6 +421,7 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group ) as b on a.combo_id=b.c_id where a.status=1 and a.combo_id in (".$ids.")"); foreach ($combos as $key => $combo) { + $tags = json_decode($combo->tags, true); $combo->tags2 = json_decode($combo->tags2, true); foreach ($tags as $k => $tag) { @@ -442,8 +442,14 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group 'money' => number_format($combo->price - $item_all_price,2) ]; } + $list=[]; + foreach ($combos as $key => $combo) { + if($combo->recommend['xiangsidu']<>'0%'){ + $list[]=$combo; + } + } - return \Yz::Return(true, "查询完成", ['combos' => $combos]); + return \Yz::Return(true, "查询完成", ['combos' => $list]); } function jaccard_similarity($set1, $set2) { // 计算交集 diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue index 1e4cddd..87f2d1e 100644 --- a/h5/pages/main/index/index.vue +++ b/h5/pages/main/index/index.vue @@ -261,7 +261,7 @@ - 10061457 + 10080726 diff --git a/h5/pages/main/tj/tjzx.vue b/h5/pages/main/tj/tjzx.vue index 1b072ab..d723729 100644 --- a/h5/pages/main/tj/tjzx.vue +++ b/h5/pages/main/tj/tjzx.vue @@ -64,9 +64,11 @@ const getComboRecommend = async () => { }); $response(response, () => { recommendPackageList.value = response.data.combos; - if (recommendPackageList.value.length) { + if (recommendPackageList.value.length>0) { popup.value.open("center"); - } + }else{ + toDetails(); + } uni.hideLoading(); }); };