share.action.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | FANWE 直播系统
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2011 http://www.fanwe.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: 云淡风轻(1956838968@qq.com)
  8. // +----------------------------------------------------------------------
  9. class shareCModule extends baseCModule
  10. {
  11. var $signPackage = '';
  12. var $user_info = '';
  13. var $wx_url = '';
  14. var $video_id = '';
  15. var $user_id = '';
  16. //分享首页
  17. public function index()
  18. {
  19. $video_id = intval($_REQUEST['video_id']);
  20. $this->video_id = $video_id;
  21. $user_id = intval($_REQUEST['user_id']);
  22. $this->user_id = $user_id;
  23. $share_id = intval($_REQUEST['share_id']);
  24. $code = strim($_REQUEST['code']);
  25. $is_black = intval($_REQUEST['is_black']);
  26. $call_back = SITE_DOMAIN.'/wap/index.php?ctl=share&act=index&user_id='.$user_id.'&video_id='.$video_id;
  27. $from = $_REQUEST['from'];
  28. $isappinstalled = $_REQUEST['isappinstalled'];
  29. if($from){
  30. $call_back.='&from='.$from;
  31. }
  32. if($isappinstalled){
  33. $call_back.='&isappinstalled='.$isappinstalled;
  34. }
  35. $this->check_user_info($call_back,$code);
  36. /*if($code&&strlen($code)==32){
  37. $call_back = SITE_DOMAIN.'/wap/index.php?ctl=share&act=index&user_id='.$user_id.'&video_id='.$video_id."&code=".$code."&state=1";
  38. $this->check_user_info($call_back,$code);
  39. }else{
  40. $call_back = SITE_DOMAIN.'/wap/index.php?ctl=share&act=index&user_id='.$user_id.'&video_id='.$video_id;
  41. $this->check_user_info($call_back);
  42. }*/
  43. if($GLOBALS['user_info']){
  44. $root['user_info'] = $GLOBALS['user_info'];
  45. }else{
  46. $root['user_info'] = false;
  47. }
  48. $user_info = $GLOBALS['db']->getRow("select * from ".DB_PREFIX."user where id=".$user_id );
  49. $root['wx_url'] = $this->wx_url;
  50. $m_config = load_auto_cache("m_config");//初始化手机端配置
  51. $root['app_logo'] = get_spec_image($m_config['app_logo']);
  52. $live_in = $GLOBALS['db']->getOne("select v.live_in from ".DB_PREFIX."video as v where v.id = ".$video_id );
  53. fanwe_require(APP_ROOT_PATH.'mapi/lib/redis/VideoRedisService.php');
  54. $video_redis = new VideoRedisService();
  55. if(intval($live_in)==0 || intval($live_in)==3){
  56. if(intval($live_in)==3){
  57. $video = $GLOBALS['db']->getRow("select vh.id as room_id,vh.group_id as group_id,vh.max_watch_number as watch_number,vh.video_vid,vh.room_type,vh.vote_number,vh.channelid,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex ,vh.live_in, vh.video_type, vh.begin_time,vh.is_live_pay from ".DB_PREFIX."video as vh left join ".DB_PREFIX."user as u on vh.user_id=u.id where vh.room_type=3 and vh.id = ".$video_id );
  58. }else{
  59. $video = $GLOBALS['db']->getRow("select vh.id as room_id,vh.group_id as group_id,vh.max_watch_number as watch_number,vh.video_vid,vh.room_type,vh.vote_number,vh.channelid,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex ,vh.live_in, vh.video_type, vh.begin_time,vh.is_live_pay from ".DB_PREFIX."video_history as vh left join ".DB_PREFIX."user as u on vh.user_id=u.id where vh.room_type=3 and vh.id = ".$video_id );
  60. }
  61. $video['viewer_num'] = $video_redis->get_video_watch_num($video['room_id']);
  62. $video['podcast'] = getuserinfo($user_id,$video['user_id'],$video['user_id']);
  63. if($video['video_type'] == 1 && $video['channelid'])
  64. {
  65. fanwe_require(APP_ROOT_PATH . 'mapi/lib/core/video_factory.php');
  66. $video_factory = new VideoFactory();
  67. $ret = $video_factory->GetVodUrls($video['channelid'], $video['begin_time']);
  68. if($video['is_live_pay'] == 1||(intval($m_config['qq_app_api'])&&intval($m_config['wx_app_api'])&&intval($m_config['sina_app_api']))){
  69. $video['urls'] = '';
  70. $video['file_id'] ='' ;
  71. }else{
  72. $video['urls'] = array_shift($ret['urls']);
  73. $video['file_id'] = $ret['file_id'];
  74. }
  75. } else {
  76. //播放地址
  77. if($video['is_live_pay'] == 1||(intval($m_config['qq_app_api'])&&intval($m_config['wx_app_api'])&&intval($m_config['sina_app_api']))){
  78. $video['video_list'] = '';
  79. $video['urls'] = '';
  80. $video['file_id'] = '';
  81. }else{
  82. $video_vid = get_vodset_by_video_id($video['room_id']);
  83. foreach($video_vid['vodset'] as $k=>$v){
  84. $playSet = $v['fileSet'][0]['playSet'];
  85. foreach($playSet as $kk=>$vv){
  86. if(strpos($vv['url'],'f0.mp4')){
  87. $video_vid_list[$k]['url'] = $vv['url'];
  88. }
  89. }
  90. $video_vid_list[$k]['image_url'] = $v['fileSet'][0]['image_url'];
  91. $video_vid_list[$k]['fileId'] = $v['fileSet'][0]['fileId'];
  92. }
  93. $video['video_list'] = $video_vid_list;
  94. $video['urls'] = $video_vid_list[0]['url'];
  95. $video['file_id'] = $video_vid_list[0]['fileId'];
  96. }
  97. }
  98. if(intval($video['room_id'])==0){
  99. $video = $GLOBALS['db']->getRow("select v.id as room_id,v.group_id as group_id,v.max_watch_number as watch_number,v.video_vid,v.room_type,v.vote_number,v.channelid,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex ,v.live_in,v.is_live_pay from ".DB_PREFIX."video as v left join ".DB_PREFIX."user as u on v.user_id=u.id where v.room_type=3 and v.id = ".$video_id );
  100. }
  101. }else{
  102. $video = $GLOBALS['db']->getRow("select v.id as room_id,v.group_id as group_id,v.max_watch_number as watch_number,v.video_vid,v.room_type,v.vote_number,v.channelid,v.play_flv,v.play_hls,v.play_rtmp,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex ,v.live_in,v.is_live_pay from ".DB_PREFIX."video as v left join ".DB_PREFIX."user as u on v.user_id=u.id where v.room_type=3 and v.id = ".$video_id );
  103. $video['viewer_num'] = $video_redis->get_video_watch_num($video['room_id']);
  104. if(intval($video['live_in'])!=1 && intval($video['live_in'])!=3){
  105. $video['live_in'] = 0;
  106. }
  107. }
  108. $root['appid'] =$m_config['vodset_app_id'] ;
  109. $root['video_type'] =$m_config['video_type'] ;
  110. if(intval($video['live_in'])!=1 && intval($video['live_in'])!=3){
  111. $video['live_in'] = 0;
  112. }
  113. //禁用分享
  114. if($m_config['sina_app_api']==0&&$m_config['wx_app_api']==0&&$m_config['qq_app_api']==0){
  115. $is_close_share = 1;
  116. }
  117. // 付费直播提示下载弹窗
  118. if($video['is_live_pay'] == 1||$is_close_share){
  119. $video['play_hls'] = '';
  120. $video['play_url'] = '';
  121. }
  122. //付费不能观看
  123. if($video['is_live_pay']==1){
  124. $video['live_in'] = 4;
  125. }
  126. //若当前 视频 不在直播状态,查找当前主播的直播视频
  127. /*if($video['live_in']!=1){
  128. //查找当前主播的直播视频
  129. $noe_video = $GLOBALS['db']->getRow("select v.id as room_id,v.group_id as group_id,v.watch_number,v.video_vid,v.room_type,v.vote_number,v.channelid,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex ,v.live_in from ".DB_PREFIX."video as v left join ".DB_PREFIX."user as u on v.user_id=u.id where v.user_id = ".$user_id." and v.live_in =1" );
  130. //若视频有值
  131. if($noe_video['room_id']){
  132. $video = $noe_video;
  133. }
  134. }*/
  135. //分享链接
  136. $video['url'] = $call_back;
  137. $root['video'] = $video;
  138. //回播日志
  139. $now = NOW_TIME-3600*24;
  140. $history = $GLOBALS['db']->getAll("select vh.id as room_id,vh.begin_time,vh.group_id as group_id,vh.max_watch_number as watch_number,vh.video_vid,vh.room_type,vh.vote_number,vh.channelid,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex from ".DB_PREFIX."video_history as vh left join ".DB_PREFIX."user as u on vh.user_id=u.id where vh.room_type=3 and vh.is_del_vod =0 and vh.is_delete =0 and vh.user_id=u.id and vh.user_id = ".$user_id." and vh.begin_time>".$now." order by vh.id desc");
  141. foreach($history as $kk=>$vv){
  142. $history[$kk]['end_time'] = format_show_date($vv['begin_time']);
  143. $history[$kk]['head_image'] = deal_weio_image($vv['head_image'],'head_image');
  144. $history[$kk]['user_url'] = url_app('home',array('podcast_id'=>$vv['user_id']));
  145. $history[$kk]['url'] = SITE_DOMAIN.'/wap/index.php?ctl=share&act=index&user_id='.$vv['user_id'].'&video_id='.$vv['room_id'];//分享链接
  146. }
  147. $root['history'] = $history;
  148. //hot_video 热门视频
  149. $video_hot = $GLOBALS['db']->getAll("select v.id as room_id,v.group_id as group_id,v.max_watch_number as watch_number,v.video_vid,v.room_type,v.vote_number,v.channelid,v.title,v.live_image,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex from ".DB_PREFIX."video as v left join ".DB_PREFIX."user as u on v.user_id=u.id where v.room_type=3 and (v.live_in = 1 or v.live_in = 3) and v.user_id=u.id and u.head_image <>'' and v.begin_time <> 0 order by v.max_watch_number desc limit 0,10");
  150. foreach($video_hot as $k=>$v){
  151. $video_hot[$k]['head_image'] = deal_weio_image($v['head_image'],'head_image');
  152. $video_hot[$k]['channelid'] = $v['channelid'];
  153. $video_hot[$k]['user_url'] = url_app('home',array('podcast_id'=>$v['user_id']));
  154. $video_hot[$k]['url'] = SITE_DOMAIN.'/wap/index.php?ctl=share&act=index&user_id='.$v['user_id'].'&video_id='.$v['room_id'];//分享链接
  155. $video_hot[$k]['live_image'] = get_spec_image($v['live_image']);
  156. }
  157. $root['video_hot'] = $video_hot;
  158. $root['app_down'] = SITE_DOMAIN.'/mapi/index.php?ctl=app_download';
  159. $root['signPackage'] = $this->signPackage;
  160. $share = array();
  161. $share['short_name'] = strim($m_config['short_name']);
  162. $share['share_title'] = strim($m_config['share_title']);
  163. $share['share_img_url'] =get_spec_image($user_info['head_image']);
  164. $share['share_wx_url'] = $video['url'];
  165. $share['share_desc'] = strim($m_config['share_title']).$user_info['nick_name'].'正在直播,快来一起看~';
  166. $root['share'] = $share;
  167. $tim_user_id = $root['user_info']['user_id'] ? $root['user_info']['user_id'] : 0;
  168. $usersig = load_auto_cache("usersig", array("id"=>$tim_user_id));
  169. $root['usersig'] = $usersig['usersig'];
  170. $root['tim_account_id'] = $tim_user_id;
  171. $m_config = load_auto_cache("m_config");
  172. $root['tim_sdkappid'] = $m_config['tim_sdkappid'];
  173. $root['tim_account_type'] = $m_config['tim_account_type'];
  174. //分销功能
  175. if((defined('OPEN_DISTRIBUTION')&&OPEN_DISTRIBUTION==1)&&intval($m_config['distribution'])==1){
  176. $root['register_url'] = SITE_DOMAIN.'/wap/index.php?ctl=distribution&act=init_register&user_id='.$share_id;
  177. }
  178. api_ajax_return($root);
  179. }
  180. //新分享首页
  181. public function live()
  182. {
  183. $video_id = intval($_REQUEST['video_id']);
  184. $user_id = intval($_REQUEST['user_id']);
  185. $share_id = intval($_REQUEST['share_id']);
  186. $code = strim($_REQUEST['code']);
  187. $call_back = SITE_DOMAIN.'/wap/index.php?ctl=share&act=live&user_id='.$user_id.'&video_id='.$video_id.'&share_id='.$share_id;
  188. $from = $_REQUEST['from'];
  189. $isappinstalled = $_REQUEST['isappinstalled'];
  190. if(trim($from)!=''){
  191. $call_back.='&from='.$from;
  192. }
  193. if(trim($isappinstalled)!=''){
  194. $call_back.='&isappinstalled='.$isappinstalled;
  195. }
  196. $this->check_user_info($call_back,$code);
  197. if($GLOBALS['user_info']){
  198. $root['user_info'] = $GLOBALS['user_info'];
  199. }else{
  200. $root['user_info'] = false;
  201. }
  202. $user_info = $GLOBALS['db']->getRow("select * from ".DB_PREFIX."user where id=".$user_id );
  203. $root['wx_url'] = $this->wx_url;
  204. $m_config = load_auto_cache("m_config");//初始化手机端配置
  205. $root['app_logo'] = get_spec_image($m_config['app_logo']);
  206. fanwe_require(APP_ROOT_PATH.'mapi/lib/redis/VideoRedisService.php');
  207. $video_redis = new VideoRedisService();
  208. $video = $video_redis->getRow_db($video_id, array('user_id', 'is_live_pay', 'live_in', 'group_id', 'play_hls', 'play_url', 'video_type', 'channelid', 'begin_time', 'create_time'));
  209. if($video['live_in']!=1 && $video['live_in']!=3){
  210. $live_list=load_auto_cache("select_video");
  211. foreach($live_list as $k=>$v){
  212. if($v['user_id']==$user_id){
  213. if($video_id != $v['room_id']){
  214. $video_id=$v['room_id'];
  215. $video = $video_redis->getRow_db($video_id, array('user_id', 'is_live_pay', 'live_in', 'group_id', 'play_hls', 'play_url', 'video_type', 'channelid', 'begin_time', 'create_time'));
  216. }
  217. }
  218. }
  219. }
  220. $video['viewer_num'] = $video_redis->get_video_watch_num($video_id);
  221. $video['podcast'] = getuserinfo($user_id,$video['user_id'],$video['user_id']);
  222. //禁用分享
  223. if($m_config['sina_app_api']==0&&$m_config['wx_app_api']==0&&$m_config['qq_app_api']==0){
  224. $is_close_share = 1;
  225. }
  226. // 付费直播提示下载弹窗
  227. if($video['is_live_pay'] == 1||$is_close_share){
  228. $video['play_hls'] = '';
  229. $video['play_url'] = '';
  230. }
  231. else if($video['live_in']==0 || $video['live_in']==3){
  232. $file_info = load_auto_cache('video_file', array(
  233. 'id' => $video_id,
  234. 'video_type' => $video['video_type'],
  235. 'channelid' => $video['channelid'],
  236. 'begin_time' => $video['begin_time'],
  237. 'create_time' => $video['create_time'],
  238. ));
  239. $video['file_id'] = $file_info['file_id'];
  240. $video['urls'] = $file_info['urls'];
  241. foreach( $video['urls'] as $url)
  242. {
  243. $info = pathinfo($url);
  244. if($info['extension'] == 'mp4')
  245. {
  246. $video['play_url'] = $url;
  247. break;
  248. }
  249. }
  250. }else if ($video['live_in'] != 1) {
  251. $video['live_in'] = 0;
  252. }
  253. //分享链接
  254. $video['url'] = $call_back;
  255. $root['video'] = $video;
  256. //回播日志
  257. $now = NOW_TIME-3600*24;
  258. $history = $GLOBALS['db']->getAll("select vh.id as room_id,vh.begin_time,vh.group_id as group_id,vh.max_watch_number as watch_number,vh.video_vid,vh.room_type,vh.vote_number,vh.channelid,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex from ".DB_PREFIX."video_history as vh left join ".DB_PREFIX."user as u on vh.user_id=u.id where vh.room_type=3 and vh.is_del_vod =0 and vh.is_delete =0 and vh.user_id=u.id and vh.user_id = ".$user_id." and vh.begin_time>".$now." order by vh.id desc");
  259. foreach($history as $kk=>$vv){
  260. $history[$kk]['end_time'] = format_show_date($vv['begin_time']);
  261. $history[$kk]['head_image'] = get_spec_image($vv['head_image']);
  262. $history[$kk]['user_url'] = url_app('home',array('podcast_id'=>$vv['user_id']));
  263. $history[$kk]['url'] = SITE_DOMAIN.'/wap/index.php?ctl=share&act=live&user_id='.$vv['user_id'].'&video_id='.$vv['room_id'];//分享链接
  264. }
  265. $root['history'] = $history;
  266. //hot_video 热门视频
  267. $video_hot = $GLOBALS['db']->getAll("select v.id as room_id,v.group_id as group_id,v.max_watch_number as watch_number,v.video_vid,v.room_type,v.vote_number,v.channelid,v.title,v.live_image,u.id as user_id,u.nick_name as nick_name,u.head_image as head_image,u.user_level as user_level,u.sex as sex from ".DB_PREFIX."video as v left join ".DB_PREFIX."user as u on v.user_id=u.id where v.room_type=3 and (v.live_in = 1 or v.live_in = 3) and v.user_id=u.id and u.head_image <>'' and v.begin_time <> 0 order by v.max_watch_number desc limit 0,10");
  268. foreach($video_hot as $k=>$v){
  269. $video_hot[$k]['head_image'] = get_spec_image($v['head_image']);
  270. $video_hot[$k]['channelid'] = $v['channelid'];
  271. $video_hot[$k]['user_url'] = url_app('home',array('podcast_id'=>$v['user_id']));
  272. $video_hot[$k]['url'] = SITE_DOMAIN.'/wap/index.php?ctl=share&act=live&user_id='.$v['user_id'].'&video_id='.$v['room_id'];//分享链接
  273. $video_hot[$k]['live_image'] = get_spec_image($v['live_image']);
  274. }
  275. $root['video_hot'] = $video_hot;
  276. $root['app_down'] = SITE_DOMAIN.'/mapi/index.php?ctl=app_download';
  277. $root['signPackage'] = $this->signPackage;
  278. $share = array();
  279. $share['short_name'] = strim($m_config['short_name']);
  280. $share['share_title'] = strim($m_config['share_title']);
  281. $share['share_img_url'] =get_spec_image($user_info['head_image']);
  282. $share['share_wx_url'] = $video['url'];
  283. $share['share_desc'] = strim($m_config['share_title']).$user_info['nick_name'].'正在直播,快来一起看~';
  284. $root['share'] = $share;
  285. $tim_user_id = $root['user_info']['user_id'] > 0 ? $root['user_info']['user_id'] : 0;
  286. $usersig = load_auto_cache("usersig", array("id" => $tim_user_id));
  287. $root['tim'] = array(
  288. 'sdkappid' => $m_config['tim_sdkappid'],
  289. 'account_type' => $m_config['tim_account_type'],
  290. 'account_id' => $tim_user_id,
  291. 'usersig' => $usersig['usersig'],
  292. );
  293. //分销功能
  294. if((defined('OPEN_DISTRIBUTION')&&OPEN_DISTRIBUTION==1)&&intval($m_config['distribution'])==1){
  295. $root['register_url'] = SITE_DOMAIN.'/wap/index.php?ctl=distribution&act=init_register&user_id='.$share_id;
  296. }
  297. api_ajax_return($root);
  298. }
  299. //检查用户是否登陆
  300. public function check_user_info($back_url,$code=''){
  301. fanwe_require(APP_ROOT_PATH."system/utils/weixin.php");
  302. $m_config = load_auto_cache("m_config");//手机端配置
  303. /*if($m_config['wx_secrit']||$m_config['wx_appid']){
  304. return false;
  305. }*/
  306. if($_REQUEST['ttype']==1){
  307. return true;
  308. }
  309. $is_weixin=isWeixin();
  310. if(!$is_weixin){
  311. return false;
  312. }
  313. $user_info = es_session::get('user_info');
  314. if(!$user_info){
  315. //解密
  316. if($code!=''){
  317. $weixin=new weixin($m_config['wx_gz_appid'],$m_config['wx_gz_secrit']);
  318. $wx_info=$weixin->scope_get_userinfo($code);
  319. }
  320. if($wx_info['openid']){
  321. $has_user = $GLOBALS['db']->getRow("select * from ".DB_PREFIX."user where wx_unionid = '".$wx_info['unionid']."'");
  322. if(!$has_user){
  323. $data=array();
  324. $data['user_name']= $wx_info['nickname'];
  325. $data['is_effect'] = 1;
  326. $data['head_image']= $wx_info['headimgurl'];
  327. syn_to_remote_image_server($wx_info['headimgurl']);
  328. $data['gz_openid']= $wx_info['openid'];
  329. $data['wx_unionid']= $wx_info['unionid'];
  330. //用户是否关注公众号
  331. $data['subscribe']= $wx_info['subscribe'];
  332. $data['create_time']= get_gmtime();
  333. $data['user_pwd'] = md5(rand(99999,9999999));
  334. $GLOBALS['db']->autoExecute(DB_PREFIX."user",$data);
  335. $user_id = $GLOBALS['db']->insert_id();
  336. $data['id'] = $user_id ;
  337. $user_info = $data;
  338. }else{
  339. if($has_user['subscribe']!=$wx_info['subscribe']){
  340. //更新公众号是否关注的状态
  341. $GLOBALS['db']->query("update ".DB_PREFIX."user set subscribe = ".$wx_info['subscribe']." where id ='".$has_user['id']."'");
  342. $has_user['subscribe'] = $wx_info['subscribe'];
  343. }
  344. $user_info = $has_user;
  345. }
  346. es_session::set("user_info", $user_info);
  347. $GLOBALS['db']->query("update ".DB_PREFIX."user set login_time = '".get_gmtime()."' where wx_unionid ='".$wx_info['unionid']."'");
  348. $this->wx_url = '';
  349. $this->user_info = $user_info;
  350. fanwe_require(APP_ROOT_PATH."system/utils/jssdk.php");
  351. $jssdk=new JSSDK($m_config['wx_gz_appid'],$m_config['wx_gz_secrit']);
  352. $jssdk->set_url($back_url);
  353. $signPackage = $jssdk->getSignPackage();
  354. $this->signPackage = $signPackage;
  355. }else{
  356. //加密
  357. /*$weixin=new weixin($m_config['wx_appid'],$m_config['wx_secrit'],$back_url);
  358. $wx_url=$weixin->scope_get_code();
  359. $this->wx_url = $wx_url;*/
  360. $this->wx_url = '';
  361. $this->user_info = $user_info;
  362. fanwe_require(APP_ROOT_PATH."system/utils/jssdk.php");
  363. $jssdk=new JSSDK($m_config['wx_gz_appid'],$m_config['wx_gz_secrit']);
  364. $jssdk->set_url($back_url);
  365. $signPackage = $jssdk->getSignPackage();
  366. $this->signPackage = $signPackage;
  367. }
  368. }else{
  369. $this->wx_url = '';
  370. $this->user_info = $user_info;
  371. fanwe_require(APP_ROOT_PATH."system/utils/jssdk.php");
  372. $jssdk=new JSSDK($m_config['wx_gz_appid'],$m_config['wx_gz_secrit']);
  373. $jssdk->set_url($back_url);
  374. $signPackage = $jssdk->getSignPackage();
  375. $this->signPackage = $signPackage;
  376. }
  377. }
  378. }
  379. ?>