find(array('key' => $template)); if (!$template) { Dever::error('消息模板不存在'); } if ($template['type'] == 1) { $method = 'notify'; } elseif ($template['type'] == 2) { $method = 'code'; } $template['method'] = explode(',', $template['method']); return Dever::load('type/' . $method, 'msg')->send($template, $account, $param); } # 验证码检查 public function check($template, $account, $code, $update = 1) { $template = Dever::db('template', 'msg')->find(array('key' => $template)); if (!$template) { Dever::error('消息模板不存在'); } if ($template['type'] == 2) { $state = Dever::load('type/code', 'msg')->check($template['id'], $account, $code, $update); if (!$state) { Dever::error('验证码错误'); } } } }