public function sendMsg() { $db = new MsgsModel(); $db->create(); if (!$db->add()) { $this->gError('发送短信时出现错误 ' . $db->getError(), 'index'); } else { $this->gSuccess('发送成功!', 'index'); } }