更新 问卷项目属相 排除 材料费

main
鹿和sa0ChunLuyu 1 year ago
parent c0a87bcabe
commit 3d22b924ce

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

Loading…
Cancel
Save