作者 王晓刚
1 个管道 的构建 通过 耗费 12 秒

商户申请

@@ -73,12 +73,16 @@ class Share extends WechatBase @@ -73,12 +73,16 @@ class Share extends WechatBase
73 private function processing($url,$user,$type){ 73 private function processing($url,$user,$type){
74 $user_id = $user['id']; 74 $user_id = $user['id'];
75 //保存头像 75 //保存头像
76 - $fileName = "avatar_$user_id";  
77 - $avatar=$this->getImage($user['avatar'],$fileName);  
78 - if($avatar['code']==1){  
79 - $this->error($avatar['msg']); 76 + if(stripos($user['avatar'],'http')){
  77 + $fileName = "avatar_$user_id";
  78 + $avatar=$this->getImage($user['avatar'],$fileName);
  79 + if($avatar['code']==1){
  80 + $this->error($avatar['msg']);
  81 + }
  82 + $avatar_url = "./uploads/avatar/avatar_$user_id.jpeg";
  83 + }else{
  84 + $avatar_url = $user['avatar'];
80 } 85 }
81 - $avatar_url = "./uploads/avatar/avatar_$user_id.jpeg";  
82 $savePath = "./uploads/poster$type/"; 86 $savePath = "./uploads/poster$type/";
83 if(!file_exists($savePath)){ 87 if(!file_exists($savePath)){
84 mkdir ($savePath,0777,true); 88 mkdir ($savePath,0777,true);