public function sendMessage($content, $type, $userId, $phone) { $messagesUsersInfo['messages_id'] = 1; $messagesUsersInfo['type'] = $type; $messagesUsersInfo['title'] = Messages::$typeList[$type]; $messagesUsersInfo['users_id'] = $userId; $messagesUsersInfo['content'] = $content; $messagesUsersInfo['create_time'] = date('Y-m-d H:i:s', time()); $messagesUsersInfo['create_user'] = '******'; $messagesUsersInfo['update_time'] = date('Y-m-d H:i:s', time()); $messagesUsersInfo['update_user'] = '******'; MessagesUsers::addInfo($messagesUsersInfo); $smsModel = Sms::getInstance(Yii::$app->params['smsUserName'], Yii::$app->params['smsPassword']); $result = $smsModel->pushMt($phone, time(), $content, 0); return $result; }