redirect('/err_mobile.html?y=1'); } //商家是否审核或存在 //$resstore=M('store')->where(array('store_id'=>getMobileStoId(),'is_audit'=>1))->find(); $resstore=tpCache("shop_info.is_audit",getMobileStoId()); if(empty($resstore)){ $this->redirect('/err_mobile.html?y=2'); } if ($resstore!=1) { $this->redirect('/err_mobile.html?y=3'); } //是否开启维护状态 $r=getManagerConf(); $arr= explode(',',$r['storelist']); if($r['site_status']==1 && !in_array(getMobileStoId(),$arr)){ $this->redirect('/up_mobile.html'); } session('user'); header("Cache-control: private"); $this->session_id = session_id(); // 当前的 session_id define('SESSION_ID',$this->session_id); //将当前的session_id保存为常量,供其它方法调用 // 判断当前用户是否手机 if(isMobile()) cookie('is_mobile','1',3600); else cookie('is_mobile','0',3600); //是否用户推荐USERID if (I('first_leader')) { Cookie::set("first_leader",I('first_leader')); } $this->request->isAjax() ? define('IS_AJAX',true) : define('IS_AJAX',false); // ($this->request->method() == 'GET') ? define('IS_GET',true) : define('IS_GET',false); // ($this->request->method() == 'POST') ? define('IS_POST',true) : define('IS_POST',false); // define('MODULE_NAME',$this->request->module()); // 当前模块名称是 define('CONTROLLER_NAME',$this->request->controller()); // 当前控制器名称 define('ACTION_NAME',$this->request->action()); // 当前操作名称是 if(ACTION_NAME!="ajaxGetMore" && ACTION_NAME!="cart3" && ACTION_NAME!="getStorageList" ) { $nowexin = ['goodsInfo','getNum','getGoodslimit','getStorageList','ajaxComment','ajaxdetail','template']; $arr_debug= explode(',',$r['storelist_debug']); if(!in_array(getMobileStoId(),$arr_debug) && !in_array(ACTION_NAME, $nowexin)){ if (!strstr($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')) { echo "
请在微信浏览器中打开!
"; die; } } //微信浏览器 if(strstr($_SERVER['HTTP_USER_AGENT'],'MicroMessenger')){ if(empty($_SESSION['wx_stoid'])|| $_SESSION['wx_stoid']!=getMobileStoId()){ $this->wei_xin_set(); }else{ if ($_SESSION['openid']) { /*--如果有存在session('?user')--*/ if (session('?user')) { $user=session('user'); if($user['openid']!=$_SESSION['openid'] || $user['store_id']!=getMobileStoId()){ $this->wei_xin_set(); } } else { $this->wei_xin_set(); } }else { $this->wei_xin_set(); } } } $user_id=session('user')['user_id']; $erpvipid=session('user')['erpvipid']; $user_mobile=session('user')['mobile']; // setcookie('erpvipid',$erpvipid,null,'/'); setcookie('user_mobile',$user_mobile,null,'/'); //获取页面地址 getlasturl(); $this->public_assign(); /*--更新最后登录时间--*/ $user00=session('user'); $a_date=date('Y-m-d',$user00['last_login']); $n_date=date('Y-m-d'); if($a_date!=$n_date){ M('users')->where('store_id',getMobileStoId())->where('user_id',$user00['user_id']) ->save(['last_login'=>time()]); $user00['last_login']=time(); session('user',$user00); //更新会员的登录时间 } } } /*--微信设置--*/ public function wei_xin_set(){ $stoid = getMobileStoId(); $this->weixin_config = M('wx_user')->where('store_id=' . $stoid)->find(); //获取微信配置 $this->assign('wechat_config', $this->weixin_config); if (is_array($this->weixin_config) && $this->weixin_config['wait_access'] == 1) { $wxuser = $this->getwxuser(); //授权获取openid以及微信用户信息 if (!empty($wxuser['errcode'])) { $this->redirect('/noauthorize.html?stoid=' . $stoid . '&er=' . $wxuser['errcode']); } if (empty($wxuser['subscribe'])) { $wxuser['subscribe'] = 0; } //微信授权是否有关注,没有插入记录或更新关注 if ($wxuser['subscribe'] == 1) { $wxopenlist = M('wx_openlist')->where(array('store_id' => $stoid, 'wxopenid' => $wxuser['openid']))->find(); if ($wxopenlist) { if ($wxopenlist['issubscribe'] == 0) { $userdata['issubscribe'] = 1; M('wx_openlist')->where('store_id', $stoid)->where('wxopenid', $wxuser['openid'])->save($userdata); } } else { $wx_users = M('wx_user')->where('store_id', $stoid)->field('wxid')->find(); $userdata['store_id'] = getMobileStoId(); $userdata['wxid'] = $wx_users['wxid']; $userdata['wxopenid'] = $wxuser['openid']; $userdata['issubscribe'] = 1; $userdata['subscribe_date'] = time(); M('wx_openlist')->insertGetId($userdata); } } //是否关注了公众号 session('subscribe', $wxuser['subscribe']);// 当前这个用户是否关注了微信公众号 $this->assign('is_sub', $wxuser['subscribe']); //微信自动登录 $logic = new UsersLogic(); $data = $logic->thirdLogin($wxuser, getMobileStoId()); if ($data['status'] == 1) { session('user', $data['result']); setcookie('user_id', $data['result']['user_id'], null, '/'); session('get_vip_base', get_vip_base());//日志 $is_d = $data['result']['is_distribut']; if (empty($is_d)) { $is_d = "0"; } setcookie('is_distribut', $is_d, null, '/'); setcookie('uname', $data['result']['nickname'], null, '/'); // 登录后将购物车的商品的 user_id 改为当前登录的id( 暂时没有用,不要启用) // $cartLogic = new \app\home\logic\CartLogic(); // $cartLogic->login_cart_handle($this->session_id,$data['result']['user_id']); //用户登录后 需要对购物车 一些操作 } } } /** * 保存公告变量到 smarty中 比如 导航 */ public function public_assign() { $tpshop_config = array(); /*--- $tp_config = M('store')->alias('a')->join('store_config b','b.store_id= a.store_id','left')->join('store_distribut c',' c.store_id=a.store_id','left') ->join('wx_user d',' d.store_id=a.store_id','left') ->field('b.hot_keywords,a.store_qqlist,a.store_name,a.store_keyword,a.store_desc,c.switch,a.store_tel,c.name,c.first_name,c.second_name,c.third_name,d.qrcode_url,a.store_logo,a.ERPId,b.categoryset,b.refund_type,b.switch_list') ->cache("mobilebase_".getMobileStoId(),3600)->where("a.store_id",getMobileStoId())->find(); ---*/ $tp_config = tpCache('shop_info', getMobileStoId()); $tp_config1 = tpCache('basic', getMobileStoId()); if ($tp_config1) $tp_config = array_merge($tp_config, $tp_config1); $tp_config2 = tpCache('distribut', getMobileStoId()); if ($tp_config2) $tp_config = array_merge($tp_config, $tp_config2); $tp_config3 = M('wx_user')->cache("mobilebase_" . getMobileStoId(), 3600)->where("store_id", getMobileStoId())->find(); if ($tp_config3) $tp_config = array_merge($tp_config, $tp_config3); $tpshop_config['hot_keywords'] = explode('|', $tp_config['hot_keywords']); $tpshop_config['qqlist'] = $tp_config['store_qqlist']; $tpshop_config['user_id'] = session('user')['user_id']; $tpshop_config['is_distribut'] = session('user')['is_distribut']; $tpshop_config['shop_info_store_title'] = $tp_config['store_name']; $tpshop_config['shop_info_store_keyword'] = $tp_config['store_keyword']; $tpshop_config['shop_info_store_desc'] = $tp_config['store_desc']; $tpshop_config['shop_info_phone'] = $tp_config['store_tel']; $tpshop_config['qrcode_url'] = $tp_config['qrcode_url']; $tpshop_config['distribut_switch'] = $tp_config['switch']; $tpshop_config['distribut_name'] = $tp_config['name']; $tpshop_config['distribut_first_name'] = $tp_config['first_name']; $tpshop_config['distribut_second_name'] = $tp_config['second_name']; $tpshop_config['distribut_third_name'] = $tp_config['third_name']; $tpshop_config['shop_info_store_logo'] = $tp_config['store_logo']; $tpshop_config['categoryset'] = $tp_config['categoryset']; $tpshop_config['refund_type'] = $tp_config['refund_type']; if ($tp_config['switch_list']) { $switch_list = json_decode($tp_config['switch_list'], true); $tpshop_config['jfcz_switch'] = $switch_list['jfcz_switch']; $tpshop_config['dhwz_switch'] = $switch_list['dhwz_switch']; $tpshop_config['yckcz_switch'] = $switch_list['yckcz_switch']; $tpshop_config['rank_switch'] = $switch_list['rank_switch']; $tpshop_config['is_closecoupon'] = $switch_list['is_closecoupon']; } if ($tp_config['mzprice_list']) { $mz = json_decode($tp_config['mzprice_list'], true); $tpshop_config['is_beauty'] = $mz['is_beauty']; $tpshop_config['mz_con'] = $mz['mz_con']; $tpshop_config['mz_tran'] = $mz['mz_tran']; $tpshop_config['mz_money'] = $mz['mz_money']; $tpshop_config['mz_goods_id'] = $mz['mz_goods_id']; $tpshop_config['mz_goods_name'] = $mz['mz_goods_name']; $tpshop_config['mz_time'] = $mz['mz_time']; } $tpshop_config['service_bz'] = $tp_config1['service_bz']; /*--制作自定义导航--*/ $ms = M('store_footer')->where('store_id', getMobileStoId())->field('id') ->where('is_use', 1)->find(); if ($ms) { $pa = '/public/template/footer/' . getMobileStoId() . '/' . $ms['id'] . '.html'; if (!file_exists(ROOT_PATH . $pa)) { $pa = "public/empty"; } else { $pa = "." . $pa; } $this->assign('fcustom_footer', $pa); } else { $this->assign('fcustom_footer', 'public/empty'); } $this->pm_erpid = tpCache('shop_info.ERPId', getMobileStoId()); $is_sort_storage = tpCache("basic.is_sort_storage", getMobileStoId()); $this->assign('is_sort_storage', $is_sort_storage); $this->assign('tpshop_config', $tpshop_config); $this->assign('pm_erpid', $this->pm_erpid); $this->assign('baseImgHost', QCLOUD_IMGURL); $this->assign('mini_host', Mini_Host()); } // 网页授权登录获取 OpendId public function GetOpenid() { if($_SESSION['openid'] && $_SESSION['wx_stoid'] && $_SESSION['wx_stoid']==getMobileStoId()) return $_SESSION['openid']; //通过code获得openid if (!isset($_GET['code'])){ //触发微信返回code码 //$baseUrl = urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); $baseUrl = urlencode($this->get_url()); $url = $this->__CreateOauthUrlForCode($baseUrl); // 获取 code地址 Header("Location: $url"); // 跳转到微信授权页面 需要用户确认登录的页面 exit(); } else { //上面获取到code后这里跳转回来 $code = $_GET['code']; $data = $this->getOpenidFromMp($code);//获取网页授权access_token和用户openid $data2 = $this->GetUserInfo($data['access_token'],$data['openid']);//获取微信用户信息 $data['nickname'] = empty($data2['nickname']) ? '微信用户' : trim($data2['nickname']); $data['sex'] = $data2['sex']; $data['head_pic'] = $data2['headimgurl']; $data['subscribe'] = $data2['subscribe']; $_SESSION['openid'] = $data['openid']; $_SESSION['wx_stoid'] = getMobileStoId(); $data['oauth'] = 'weixin'; if(isset($data['unionid'])){ $data['unionid'] = $data['unionid']; } return $data; } } /*--获取微信信息--*/ public function getwxuser() { $stoid = getMobileStoId(); $cookie_code = Cookie::get("code" . $stoid); $cookie_data=Cookie::get("code_data" . $stoid); mlog('cookiedata值:' . json_encode($cookie_data), 'geturl/' . getMobileStoId()); mlog('cookie值:' . json_encode($cookie_code), 'geturl/' . getMobileStoId()); if (empty($cookie_code) || empty($cookie_data)) { //通过code获得openid if (!isset($_GET['code'])) { //触发微信返回code码 //$baseUrl = urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); $baseUrl = urlencode($this->get_url()); $url = $this->__CreateOauthUrlForCode($baseUrl); // 获取 code地址 Header("Location: $url"); // 跳转到微信授权页面 需要用户确认登录的页面 exit(); } else { //上面获取到code后这里跳转回来 $code = $_GET['code']; mlog($code . '-' . date('Y-m-d H:i:s'), 'code/' . getMobileStoId()); $data = $this->getOpenidFromMp($code);//获取网页授权access_token和用户openid //如果授权失败,去掉code,重新授权 if(empty($data) || $data['errcode']=='40029') { $url1=$this->get_newurl(); $baseUrl = urlencode($url1); $url = $this->__CreateOauthUrlForCode($baseUrl); // 获取 code地址 Header("Location: $url"); // 跳转到微信授权页面 需要用户确认登录的页面 exit(); } Cookie::set("code" . $stoid,$code); $data2 = $this->GetUserInfo($data['access_token'], $data['openid']);//获取微信用户信息 $data['nickname'] = empty($data2['nickname']) ? '微信用户' : trim($data2['nickname']); $data['sex'] = $data2['sex']; $data['head_pic'] = $data2['headimgurl']; $data['subscribe'] = $data2['subscribe']; $_SESSION['openid'] = $data['openid']; $_SESSION['wx_stoid'] = getMobileStoId(); $data['oauth'] = 'weixin'; if (isset($data['unionid'])) { $data['unionid'] = $data['unionid']; } mlog('unionid:' . json_encode($data['unionid']), 'getusers/' . getMobileStoId()); mlog('subscribe:' . json_encode($data['subscribe']), 'getusers/' . getMobileStoId()); } Cookie::set("code_data" . $stoid,$data); return $data; }else{ $data=Cookie::get("code_data" . $stoid); Cookie::delete("code_data" . $stoid); Cookie::delete("code" . $stoid); return $data; } } /** * 获取当前的url 地址 * @return type */ private function get_url() { $sys_protocal =((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://'; $php_self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; $path_info = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : ''; $relate_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $php_self.(isset($_SERVER['QUERY_STRING']) ? '?'.$_SERVER['QUERY_STRING'] : $path_info); return $sys_protocal.(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '').$relate_url; } /** * * 通过code从工作平台获取openid机器access_token * @param string $code 微信跳转回来带上的code * * @return openid */ public function GetOpenidFromMp($code) { //通过code获取网页授权access_token 和 openid 。网页授权access_token是一次性的,而基础支持的access_token的是有时间限制的:7200s。 //1、微信网页授权是通过OAuth2.0机制实现的,在用户授权给公众号后,公众号可以获取到一个网页授权特有的接口调用凭证(网页授权access_token),通过网页授权access_token可以进行授权后接口调用,如获取用户基本信息; //2、其他微信接口,需要通过基础支持中的“获取access_token”接口来获取到的普通access_token调用。 $url = $this->__CreateOauthUrlForOpenid($code); $ch = curl_init();//初始化curl curl_setopt($ch, CURLOPT_TIMEOUT, 300);//设置超时 curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,FALSE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $res = curl_exec($ch);//运行curl,结果以jason形式返回 mlog('获取授权信息:' . json_encode($res), 'getusers/' . getMobileStoId()); $data = json_decode($res,true); curl_close($ch); return $data; } /** * * 通过access_token openid 从工作平台获取UserInfo * @return openid */ public function GetUserInfo($access_token,$openid) { // 获取用户 信息 $url = $this->__CreateOauthUrlForUserinfo($access_token, $openid); $ch = curl_init();//初始化curl curl_setopt($ch, CURLOPT_TIMEOUT, 300);//设置超时 curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $res = curl_exec($ch);//运行curl,结果以jason形式返回 $data = json_decode($res, true); curl_close($ch); //获取用户是否关注了微信公众号, 再来判断是否提示用户 关注 mlog('unionid01:' . $res . '-nk' . $data['nickname'] . '-img' . $data['headimgurl'], 'getusers/' . getMobileStoId()); //if(!isset($data['unionid'])){ //$access_token2 = $this->get_access_token();//获取基础支持的access_token $access_token2 = m_get_access_token($this->weixin_config); $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=$access_token2&openid=$openid&lang=zh_CN"; mlog('unionid011:' . $url, 'getusers/' . getMobileStoId()); $subscribe_info = httpRequest($url, 'GET'); mlog('unionid02:' . $subscribe_info, 'getusers/' . getMobileStoId()); if ($subscribe_info) { $subscribe_info = json_decode($subscribe_info, true); if ($subscribe_info['subscribe']) { $data['subscribe'] = $subscribe_info['subscribe']; } } //} if (empty($data['subscribe'])) { $data['subscribe'] = 0; } return $data; } public function get_access_token(){ return m_get_access_token($this->weixin_config); } /** * * 构造获取code的url连接 * @param string $redirectUrl 微信服务器回跳的url,需要url编码 * * @return 返回构造好的url */ private function __CreateOauthUrlForCode($redirectUrl) { $urlObj["appid"] = $this->weixin_config['appid']; $urlObj["redirect_uri"] = "$redirectUrl"; $urlObj["response_type"] = "code"; // $urlObj["scope"] = "snsapi_base"; $urlObj["scope"] = "snsapi_userinfo"; $urlObj["state"] = "STATE"; $urlObj["component_appid"]=open_appId; $bizString = $this->ToUrlParams($urlObj); mlog("网址1:https://open.weixin.qq.com/connect/oauth2/authorize?".$bizString."#wechat_redirect","geturl/".getMobileStoId()); return "https://open.weixin.qq.com/connect/oauth2/authorize?".$bizString."#wechat_redirect"; } /** * * 构造获取open和access_toke的url地址 * @param string $code,微信跳转带回的code * * @return 请求的url */ private function __CreateOauthUrlForOpenid($code) { $urlObj["appid"] = $this->weixin_config['appid']; $urlObj["code"] = $code; $urlObj["grant_type"] = "authorization_code"; $urlObj["component_appid"] = open_appId; $urlObj["component_access_token"] = getcomponent_access_token(); $bizString = $this->ToUrlParams($urlObj); mlog("网址2:https://api.weixin.qq.com/sns/oauth2/component/access_token?".$bizString,"geturl/".getMobileStoId()); return "https://api.weixin.qq.com/sns/oauth2/component/access_token?".$bizString; } /** * * 构造获取拉取用户信息(需scope为 snsapi_userinfo)的url地址 * @return 请求的url */ private function __CreateOauthUrlForUserinfo($access_token,$openid) { $urlObj["access_token"] = $access_token; $urlObj["openid"] = $openid; $urlObj["lang"] = 'zh_CN'; $bizString = $this->ToUrlParams($urlObj); mlog("网址3:https://api.weixin.qq.com/sns/userinfo?".$bizString,"geturl/".getMobileStoId()); return "https://api.weixin.qq.com/sns/userinfo?".$bizString; } /** * * 拼接签名字符串 * @param array $urlObj * * @return 返回已经拼接好的字符串 */ private function ToUrlParams($urlObj) { $buff = ""; foreach ($urlObj as $k => $v) { if($k != "sign"){ $buff .= $k . "=" . $v . "&"; } } $buff = trim($buff, "&"); return $buff; } public function ajaxReturn($data){ exit(json_encode($data)); } /*--线上与线下绑定,调用线下接口进行取ERPVIPID--*/ public function get_erp_vipid(){ /*---- $list = array("access_token"=>"wxd.vip.vipinfo.list.get"); $where['MobileTel']=array('=',"13599727122"); $tk=M("store")->where("store_id",getAdmStoId())->field("api_token")->find(); $array =array( 'token'=>$tk['api_token'], 'data'=>"", 'map'=>$where, 'order'=>"", ); $json=json_encode($array); $url=GetSignUrl($list); if(empty($url)){ return json(["code"=>"-1","msg"=>"生成签名错误"]); } $rs=http_post_json($url,$json);---*/ $tk=M("store")->where("store_id",getMobileStoId())->field("api_token")->find(); $where['MobileTel']=array('=',"13599727122"); $rs1=getApiData("wxd.vip.vipinfo.list.get",$tk['api_token'],null,$where); $rs=[$rs1,'ok']; if($rs){ //return urldecode($rs[0]); return json_encode($rs); }else{ return json(["code"=>"-1","msg"=>"获取接口数据错误"]); } //mlog($res); } /*--线上与线下绑定,调用线下接口进行取ERPVIPID--*/ public function add_erp_vip(){ /*---- $list = array("access_token"=>"wxd.vip.vipinfo.add"); $tk=M("store")->where("store_id",getAdmStoId())->field("api_token")->find(); $data =array( 'VIPName'=>'minghai', 'VIPNo'=>'13599727122', 'Id'=>'qjhtest', 'MobileTel'=>'13599727122', ); $jsonre=array( 'token'=>$tk['api_token'], 'data'=> array($data), 'map'=>'', 'order'=>'', ); $json=json_encode($jsonre); //var_dump($jsonre);die; $url=GetSignUrl($list); var_dump($url);die; if(empty($url)){ return json(["code"=>"-1","msg"=>"生成签名错误"]); } $rs=http_post_json($url,$json);---*/ $tk=M("store")->where("store_id",getMobileStoId())->field("api_token")->find(); $data =array( 'VIPName'=>'minghai', 'VIPNo'=>'13599727122', 'Id'=>'qjhtest', 'MobileTel'=>'13599727122', ); $rs1=getApiData("wxd.vip.vipinfo.list.get",$tk['api_token'],array($data)); $rs=[$rs1,"1"]; if($rs){ //return urldecode($rs[0]); return json_encode($rs); }else{ return json(["code"=>"-1","msg"=>"获取接口数据错误"]); } //mlog($res); } /*--获取先的地址--*/ public function get_newurl() { $url = $this->get_url(); $arr = parse_url($url); $arr_query = $this->convertUrlQuery($arr['query']); $newurl1=""; if ($this->getUrlQuery($arr_query)){ $newurl1="&".$this->getUrlQuery($arr_query); } $newport=""; if ($arr['port']!=="80" && $arr['port']) { $newport=":".$arr['port']; } $newurl=$arr['scheme']."://".$arr['host'].$newport.$arr['path']."?1=1".$newurl1; return $newurl; } //获取参数 public function convertUrlQuery($query) { $queryParts = explode('&', $query); $params = array(); foreach ($queryParts as $param) { $item = explode('=', $param); $params[$item[0]] = $item[1]; } return $params; } /** * 将参数变为字符串 * @param $array_query * @return string string 'm=content&c=index&a=lists&catid=6&area=0&author=0&h=0ion=0&s=1&page=1' (length=73) */ public function getUrlQuery($array_query) { $tmp = array(); foreach($array_query as $k=>$param) { if ($k==="code" || $k==="state"){} else { $tmp[] = $k.'='.$param; } } $params = implode('&',$tmp); return $params; } public function buy_page_assign($p_dis_type=0) { if (session('user')['head_pic']) { $qc = new \app\home\controller\Index(); $s_head_pic = mb_img_curl_url(session('user')['head_pic'], 2); $this->assign('share_head_pic', $s_head_pic['data']); } /*--- if($p_dis_type) { $pk = mb_get_user_sto($p_dis_type); $this->assign("de_pick", $pk); }--*/ } }