当前位置: 首页>>代码示例>>PHP>>正文


PHP JSSDK::getCardExtPackage方法代码示例

本文整理汇总了PHP中JSSDK::getCardExtPackage方法的典型用法代码示例。如果您正苦于以下问题:PHP JSSDK::getCardExtPackage方法的具体用法?PHP JSSDK::getCardExtPackage怎么用?PHP JSSDK::getCardExtPackage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JSSDK的用法示例。


在下文中一共展示了JSSDK::getCardExtPackage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: substr

 function exchange_online()
 {
     if (!isWeixinBrowser()) {
         $this->error("很遗憾,该页面仅支持微信客户端!");
     }
     $agent = $_SERVER["HTTP_USER_AGENT"];
     $version = (int) substr($agent, strpos($agent, "icroMessenger") + strlen("icroMessenger") + 1, 1);
     if ($version < 6) {
         //微信版本判断
         $this->error("您的微信版本低于6.0,不支持微信卡券功能!");
     }
     //获取个人中奖信息
     $target_id = I('id');
     $openId = get_openid();
     $token = get_token();
     $userInfo = getWeixinUserInfo($openId, $token);
     $this->assign('userInfo', $userInfo);
     $map['id'] = $target_id;
     $Scartch = M('Scratch')->field('use_tips')->where($map)->find();
     $this->assign('Scratch', $Scartch);
     unset($map);
     $map['openid'] = $openId;
     $map['token'] = $token;
     $map['target_id'] = $target_id;
     $map['prize_id'] = array('gt', 0);
     $my_prizes = M('sn_code')->where($map)->order('prize_id')->select();
     unset($map);
     $map['addon'] = 'Scratch';
     $map['target_id'] = $target_id;
     $prizes = M('prize')->where($map)->order('sort asc')->select();
     $my_prizes_sortbyid = array();
     foreach ($prizes as $value) {
         $my_prizes_sortbyid[$value['id']] = $value;
     }
     //dump($my_prizes_sortbyid);exit();
     vendor('jssdk');
     $jssdk = new \JSSDK();
     $signPackage = $jssdk->GetSignPackage();
     //dump($signPackage);exit();
     $this->assign('signPackage', $signPackage);
     foreach ($my_prizes as $value) {
         //card_id
         $value['card_id'] = $my_prizes_sortbyid[$value['prize_id']]['card_id'];
         $cardExtPackage = $jssdk->getCardExtPackage($value['card_id']);
         $value['cardExtPackage'] = $cardExtPackage;
         $my_prizes_sortbyid[$value['prize_id']]['prizes'][] = $value;
     }
     //dump($my_prizes_sortbyid);exit();
     $this->assign('my_prizes', $my_prizes_sortbyid);
     //获取对应图片资源
     $model_id = 175;
     unset($map);
     $map['target_id'] = $target_id;
     $map['token'] = $token;
     $img_res = M(get_table_name($model_id))->where($map)->find();
     $this->assign('img_res', $img_res);
     $this->display();
 }
开发者ID:strivi,项目名称:siples,代码行数:58,代码来源:ScratchController.class.php


注:本文中的JSSDK::getCardExtPackage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。