private function procAlipay() { $post = I('post.', '', ''); if ($post['service'] == 'alipay.service.check') { $this->platform->touchCheck(); } if ($post['service'] == 'alipay.mobile.public.message.notify') { $xml = '<?xml version="1.0" encoding="utf-8"?>' . iconv('gbk', 'utf-8', $post['biz_content']); $message = $this->platform->parse($xml); //Log::write(var_export($message, true), Log::INFO); // booking 登记会员 $this->platform->booking($message); $this->route($message); } }
public function booking($message) { $fan = array(); $fan['openid'] = $message['from']; $fan['unionid'] = $message['from']; $fan['subscribe'] = 1; if ($message['type'] == 'subscribe') { $fan['subscribetime'] = $message['time']; } elseif ($message['type'] == 'unsubscribe') { $fan['subscribe'] = 0; $fan['unsubscribetime'] = $message['time']; } else { $fan['subscribetime'] = TIMESTAMP; } $tag = @json_decode($message['original']['userinfo'], true); if (!empty($tag)) { $fan['tag'] = serialize($tag); } parent::booking($fan); }