From 61ba6a1fb5408f37ebe1a35cad8b4626ab01e679 Mon Sep 17 00:00:00 2001 From: yanzai Date: Sun, 6 Oct 2024 17:46:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A5=97=E9=A4=90=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/H5/ComboController.php | 18 ++++++++++++++++++ h5/pages/main/index/index.vue | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index b6fedbd..6473625 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -351,6 +351,24 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4) $count = DB::table('orders')->where(['combo_id' => $combo->combo_id])->whereIn('status', [2, 4])->count(); $combo->saleCount = $count; } + + foreach ($combos as $key => $combo) { + + $tags = json_decode($combo->tags, true); + $combo->tags2 = json_decode($combo->tags2, true); + foreach ($tags as $k => $tag) { + $tags[$k] = ['text' => $tag, + 'text_color' => '#47ABD8', + 'color' => '#EBF5FC' + ]; + } + $combo->tags = $tags; + $combo->tags[] = [ + 'text' => $combo->item_count . '个项目', + 'text_color' => '#34C292', + 'color' => '#E9F8F3', + ]; + } return \Yz::Return(true, "查询完成", ['list' => $combos]); } diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue index 166a714..06e9649 100644 --- a/h5/pages/main/index/index.vue +++ b/h5/pages/main/index/index.vue @@ -260,7 +260,7 @@ - 09291029 + 10061457