From 3d22b924ce7ff2258da99f89a18463f53919cd9f Mon Sep 17 00:00:00 2001 From: sa0ChunLuyu Date: Thu, 24 Oct 2024 10:45:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=B1=9E=E7=9B=B8=20=E6=8E=92=E9=99=A4=20?= =?UTF-8?q?=E6=9D=90=E6=96=99=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/H5/QuestionnairesLogsController.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php b/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php index e9d05bb..9c9eae8 100644 --- a/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php +++ b/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php @@ -124,7 +124,28 @@ class QuestionnairesLogsController extends Controller public function item_count($items, $check_items) { - $ic = count($items) + count($check_items['items']) + count($check_items['combo_items']); + if (count($items)) { + $items_count = DB::table('items')->whereIn('item_id', $items) + ->where('keshi_name', '!=', '材料费')->where('status', 1)->count(); + } else { + $items_count = 0; + } + if (count($check_items['items'])) { + $check_sum_count = DB::table('items') + ->whereIn('item_id', $check_items['items']) + ->where('keshi_name', '!=', '材料费')->where('status', 1)->count(); + } else { + $check_sum_count = 0; + } + + if (count($check_items['combo_items'])) { + $combo_count = DB::table('items') + ->whereIn('item_id', $check_items['combo_items']) + ->where('keshi_name', '!=', '材料费')->where('status', 1)->count(); + } else { + $combo_count = 0; + } + $ic = $items_count + $check_sum_count + $combo_count; return $ic; }