public function menu_click($data){
if ($data['EventKey'] == '人工客服') {
$this->reply('欢迎使用人工客服服务(客服在线时间为:9:00 - 18:00),正在为您转接,请稍后....');
$this->reply('转接到人工客服','transfer_customer_service');
}elseif($data['EventKey'] == '特色保险'){
$this->reply('小伙伴正在加班加点完善中,敬请期待...');
}elseif($data['EventKey'] == '免费500万'){
$time = strtotime('2015-5-1') - time() - 3600*8;
$time = intval($time/3600/24).'天'.date('H小时i分s秒',$time);
$str = "女士们,先生们:
<a href='http://mp.weixin.qq.com/s?__biz=MzA3NDU4NTA2Mw==&mid=206648533&idx=1&sn=365289e4308022d683b89c89652cc84d&scene=1&from=groupmessage&isappinstalled=0#rd'>500万</a>正在飞来的路上,预计在".$time ."后到达,请您耐心等待,谢谢! ";
$this->reply($str);
}else{
$this->reply('小伙伴正在加班加点制作,敬请期待...');
}
}用$this->reply();回复了用户消息,就不转发到多客服了,不知道大家用什么方法解决呢? //回复消息
public function reply($content,$type='text'){
$token = C(TOKEN);
$wechat = new Wechat($token);
$message = $wechat->request();//接受用户发来的消息返回去
if($message && is_array($message)){
$wechat->response($content,$type);
}
} 最佳答案