sendSms($msgType, $templateParams); } /** * 发送微信订阅消息 * @param $wxappId * @param $params * @return mixed * @throws \app\common\exception\BaseException * @throws \think\Exception * @throws \think\exception\DbException */ protected function sendWxSubMsg($wxappId, $params) { // 获取小程序配置 $wxConfig = WxappModel::getWxappCache($wxappId); // 请求微信api执行发送 $WxSubMsg = new WxSubMsg($wxConfig['app_id'], $wxConfig['app_secret']); return $WxSubMsg->sendTemplateMessage($params); } /** * 字符串截取前20字符 * [用于兼容thing数据类型] * @param $content * @param int $length * @return bool|string */ protected function getSubstr($content, $length = 20) { return str_substr($content, $length); } }