/** * author: codeMonkey QQ:631872807 * @param $type * 获取转向URL */ public function getRedirectUrl($type, $parmas = array()) { switch ($type) { case Value::$REDIRECT_USER_INDEX: //首页 $redirectUrl = $this->createMobileUrl('index', $parmas, true); break; case Value::$REDIRECT_KJ: $redirectUrl = $this->createMobileUrl('kj', $parmas, true); breka; } return MonUtil::str_murl($redirectUrl); }
/** * author: 微赞 * @param $order * @param $item * 发送模板消息 */ public function sendPayTemplateMsg($order, $item) { $template = $this->findTemplateSetting(); if ($template['payenable'] == 1) { $templateMsg = array(); $templateMsg['template_id'] = $template['paytid']; $templateMsg['touser'] = $order['openid']; $templateMsg['url'] = MonUtil::str_murl($this->createMobileUrl('OrderItem', array('openid' => $order['openid'], 'iid' => $item['id']), true)); $templateMsg['topcolor'] = '#FF0000'; $data = array(); $data['first'] = array('value' => "恭喜" . $order['uname'] . "支付" . $item['iname'] . "成功!", 'color' => '#173177'); $data['orderMoneySum'] = array('value' => $order['zf_price'], 'color' => '#173177'); $data['orderProductName'] = array('value' => $item['iname'], 'color' => '#173177'); $data['remark'] = array('value' => "保存好您的支付凭证哦!欢迎下次再次预定", 'color' => '#173177'); $templateMsg['data'] = $data; $jsonData = json_encode($templateMsg); WeUtility::logging('info', "发送模板消息数据" . $jsonData); load()->func('communication'); $acessToken = $this->getAccessToken(); $apiUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" . $acessToken; $result = ihttp_request($apiUrl, $jsonData); WeUtility::logging('info', "发送支付消息返回内容" . $result); } }
public function getScanCode($rid) { $codeArray = array('exeUrl' => MonUtil::str_murl($this->createMobileUrl('ExchangeApi', array('rid' => $rid), true)), 'gcode' => $this::$GCODE); return base64_encode(json_encode($codeArray)); }