public function indext() { // if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') == false) { // $openid="o4CBRwu4gN7w8JZsVCw6leu9g2-Y"; // session('openid',$openid); // } if ($_SERVER['SERVER_NAME'] != 'localhost' && strpos($_SERVER['SERVER_NAME'], '192.168.') === false) { //try_login(); } else { // $openid="o4CBRwu4gN7w8JZsVCw6leu9g2-Y"; // session('openid',$openid); //try_login(); } // logger("dddddd"); /****分享与定位***/ $wxm = new WxUserInfo(); $signPackage = $wxm->getSignPackage(); $this->assign('signPackage', $signPackage); /****地图apk*******/ $m = D('Home/System'); $GLOBALS['CONFIG'] = $m->loadConfigs(); $this->assign('CONF', $GLOBALS['CONFIG']); $this->assign('title', "粗卡"); $this->assign('tabid', 'home'); $addb = D('ads'); $ads = $addb->queryByType(-1); $this->assign('ads', $ads); $this->display(); }
public function index() { $openid = get_user_open_id(); $openid = '' . $openid; $mMember = D('M/Member'); $result = $mMember->GetByOpenid($openid); //echo dump($result); if (!$result) { $this->redirect('Home/selectreg'); exit; } else { //更新session session("cardid", $result["CardId"]); session("uid", $result["uid"]); session("Mobile", $result["Mobile"]); session("MemberItem", $result); } //生新查询头像 $userimg = '' . session("userimg"); if (strlen($userimg) < 10) { $wxm = new WxUserInfo(); $userimg = $wxm->callback($openid); if (strlen($userimg) > 10) { session("userimg", $userimg); //更新到对像 $mMember->ChangeImgPath($openid, $userimg); } } $this->assign('headimgurl', $userimg); $this->assign('tabid', 'member'); $this->assign('title', "个人中心"); $this->assign('data', $result); $this->display(); }
public function indexs() { // 获取广告 $wxm = new WxUserInfo(); $signPackage = $wxm->getSignPackage(); $this->assign('signPackage', $signPackage); $this->assign('title', '商城-微信API测试'); $this->display(); }
public function index() { $this->assign('title', "速达农村配送"); // $this->assign('tabid', 'shops'); /****分享与定位***/ $wxm = new WxUserInfo(); $signPackage = $wxm->getSignPackage(); $this->assign('signPackage', $signPackage); $this->display(); }
public function index() { $this->assign('title', "推荐餐厅"); //$this->assign('data', $result); //****分享与定位***/ $wxm = new WxUserInfo(); $signPackage = $wxm->getSignPackage(); $this->assign('signPackage', $signPackage); $addb = D('ads'); $ads = $addb->queryByType(-2); $this->assign('ads', $ads); $this->display(); }
public function detail() { // 获取广告 $addb = D('ads'); $shopId = I("shopid", 0); $ads = $addb->queryByShopid($shopId); $this->assign('ads', $ads); /****分享与定位***/ $wxm = new WxUserInfo(); $signPackage = $wxm->getSignPackage(); $this->assign('signPackage', $signPackage); $m = D('M/Shops'); $data = $m->detail($shopId); $this->assign('shop', $data); $this->assign('shopId', $shopId); $this->assign('title', '速达农村配送-' . $data["shopName"]); $this->display(); }
public function map() { $wxm = new WxUserInfo(); $signPackage = $wxm->getSignPackage(); $this->assign('signPackage', $signPackage); /****地图apk*******/ $m = D('Home/System'); $GLOBALS['CONFIG'] = $m->loadConfigs(); $this->assign('CONF', $GLOBALS['CONFIG']); $this->assign('title', I('shopName')); $this->display(); }
public function SendOrderNotifyToShops() { $wxm = new WxUserInfo(); $m = D('M/Orders'); $obj = $m->orderDetailForNotify(283); if (!$obj) { return; } $openid = $obj["wxopenid"]; //没有设置提醒 if (empty($openid)) { return; } $ACCESS_TOKEN = $wxm->accessToken(); $url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={$ACCESS_TOKEN}"; $createTime = $obj["createTime"]; $totalMoney = $obj["totalMoney"]; $goods = $obj["goods"]; $orderType = $obj["orderType"]; $orderTypeName = ""; if ($orderType == "1" || $orderType == "2") { $orderTypeName = "一元购订单"; } else { if ($orderType == "3") { $orderTypeName = "商城订单"; } else { $orderTypeName = "商家订单"; } } $username = '******'; $orderItemData = "订单金额:{$totalMoney}\n商品详情:{$goods}"; $json = ' { "touser":"******", "template_id":"JsODEGXf-FzqYgRddUCbgMmTDHG8htzE0uKDFKhC6xA", "url":"http://www.cukayun.cn/index.php/M", "topcolor":"#FF0000", "data":{ "orderType": { "value":"' . $orderTypeName . '", "color":"#173177" }, "tradeDateTime":{ "value":"06月07日 19时24分", "color":"#173177" }, "customerInfo":{ "value":"' . $username . '", "color":"#173177" }, "orderItemName":{ "value":"商品信息", "color":"#173177" }, "orderItemData":{ "value":"' . $orderItemData . '", "color":"#173177" }, "remark":{ "value":"remark", "color":"#173177" } } } '; $result = $this->postData($url, $json); echo $json; echo $result; }
public function getsharekey() { $wxm = new WxUserInfo(); $signPackage = $wxm->getSignPackage(); $this->ajaxReturn($signPackage, 'JSON'); }
public function create_qr111($openid = 'oyKgswI_fyh9dM5rdw6SAEy0dEUg', $type = 1) { //找到此用户的uid $uid = M('member')->where(array('OpenID' => $openid))->limit(1)->getField('uid'); $uid = $type . $uid; $param = array('expire_seconds' => 2592000, 'action_name' => 'QR_SCENE', 'action_info' => array('scene' => array('scene_id' => $uid))); $param = json_encode($param); $wxmsg = new WxUserInfo(); $access_token = $wxmsg->accessToken(); $rs = post('https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=' . $access_token, $param); $rs = json_decode($rs); //处理object $rs = object_array($rs); echo 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . $rs['ticket']; // print_r($rs); }
public function create_fqr($type = '') { //找到此用户的uid $uid = '00'; // $type='91' $dotype = '7777'; $uid = $dotype . $type . $uid; //https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN //{"expire_seconds": 604800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}} $param = array('expire_seconds' => 2592000, 'action_name' => 'QR_SCENE', 'action_info' => array('scene' => array('scene_id' => $uid))); $param = json_encode($param); $wxmsg = new WxUserInfo(); $access_token = $wxmsg->accessToken(); $rs = post('https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=' . $access_token, $param); $rs = json_decode($rs); //处理object $rs = object_array($rs); header('location:https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . $rs['ticket']); }