'文字', 'link' => '链接', 'image' => '图片', 'voice' => '语音', 'video' => '视频', 'news' => '图文消息']; } /** * 通用类型获取器 * * @param string $value * @param array $data * @return string */ public function getGroupTextAttr($value, $data) { $list = ['keywords' => '关键词回复', 'subscribe' => '关注回复', 'default' => '默认回复']; $value = $value ?: ($data['group'] ?? null); return isset($list[$value]) ? $list[$value] : ''; } }