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; }