本文整理汇总了PHP中Wechat::curlGet方法的典型用法代码示例。如果您正苦于以下问题:PHP Wechat::curlGet方法的具体用法?PHP Wechat::curlGet怎么用?PHP Wechat::curlGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wechat
的用法示例。
在下文中一共展示了Wechat::curlGet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updatefeedback
function updatefeedback()
{
$id = $this->_get('id', 'intval');
header('Content-Type:text/html;charset=utf-8');
$wetallroute = dirname(dirname(dirname(dirname(dirname(__FILE__)))));
//dump($wetallroute);exit;
include $wetallroute . "/wxpay/config.php";
//dump($config);exit;
include $wetallroute . "/wxpay/lib.php";
$wechat = new Wechat();
// openid 与 feedback参数都可以从数据库中得到
$feedback = $this->_mod->where(array('id' => $id))->find();
//dump($feedback);exit;
//$content = 'http://api.weixin.qq.com/cgi-bin/pay/delivernotify?access_token=' . $wechat->getAccessToken($config) . '&openid=' . $feedback['openid'] . '&feedbackid=' . $feedback['feedbackid'];
$content = 'https://api.weixin.qq.com/payfeedback/update?access_token=' . $wechat->getAccessToken($config) . '&openid=' . $feedback['openid'] . '&feedbackid=' . $feedback['feedbackid'];
//dump($content);
$result = $wechat->curlGet($content);
//dump($result);exit;
$result = json_decode($result, true);
if ($result['errcode'] == 0) {
//echo 'success';
//IS_AJAX && $this->ajaxReturn(1, $result['errmsg'], '', 'edit');
$this->_mod->where(array('id' => $id))->save(array('status' => 1));
$this->success('通知微信成功!');
} elseif ($result['errcode'] == -1 && $result['errmsg'] == 'system error') {
$this->_mod->where(array('id' => $id))->save(array('status' => 1));
$this->success('已经通知过微信,更改状态成功!');
} else {
//IS_AJAX && $this->ajaxReturn(0, $result['errmsg']);
$this->error($result['errmsg']);
}
}