', ''], ['type', '=', 1] ]; $lists = NoticeSetting::where($where)->field('mnp_notice')->select()->toArray(); $template_id = []; foreach ($lists as $item) { if (isset($item['mnp_notice']['status']) && $item['mnp_notice']['status'] != YesNoEnum::YES) { continue; } $template_id[] = $item['mnp_notice']['template_id'] ?? ''; // 限制3条 if (count($template_id) == 3) { break; } } return $template_id; } }