weixinHandler = new WeiXinAccount($account); } /** * 发送自定义的模板消息 * @param string $touser 发送给谁(微信openId) * @param string $template_id 模板的id(通过微信后台或接口, 增加的模板产生的唯一id) * @param array $data 消息体数据 * @param string $url 跳转地址 * @param string $topcolor 颜色 * @return array|bool true if the method call succeeded, false otherwise. */ public function do_send($touser, $template_id, $data, $url='',$topcolor = '#7B68EE') { $pdo = $this->db; return $this->weixinHandler->sendTplNotice($this->db,$pdo,$touser,$template_id,$data,$url,$topcolor); } public function SendMessage($to_user, $template_id, $target_url, $parameter, $color = '#7b68ee') { $pdo = $this->db; return $this->weixinHandler->SendTemplateMessage($to_user, $template_id, $target_url, $parameter, $color, $this->db, $pdo); } /** @inject("ioc_factory") */ private $factory; /** * @property({"default":"@db"}) * @var PDO */ public $db; }