作者 何书鹏
1 个管道 的构建 失败

生成小程序二维码

@@ -417,17 +417,17 @@ class Index extends Api @@ -417,17 +417,17 @@ class Index extends Api
417 mkdir($dir,0777,true); 417 mkdir($dir,0777,true);
418 } 418 }
419 419
420 - // // 职位小程序码  
421 - // $qrcode = $dir.'/qrcode_'.$job_id.'.png';  
422 - // if(!file_exists($qrcode)){  
423 - // $response = Wechat::miniProgram()->app_code->getUnlimit($job_id, [  
424 - // 'page' => 'pages/verificationPage/verificationPage',  
425 - // 'width' => 169,  
426 - // ]);  
427 - // if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {  
428 - // $response->saveAs($dir, str_replace($dir.'/','',$qrcode));  
429 - // }  
430 - // } 420 + // 职位小程序码
  421 + $qrcode = $dir.'/qrcode_'.$job_id.'.png';
  422 + if(!file_exists($qrcode)){
  423 + $response = Wechat::miniProgram()->app_code->getUnlimit($job_id, [
  424 + 'page' => 'pages/zhiwei_xq/zhiwei_xq',
  425 + 'width' => 169,
  426 + ]);
  427 + if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
  428 + $response->saveAs($dir, str_replace($dir.'/','',$qrcode));
  429 + }
  430 + }
431 //将职位封面图保存到本地 431 //将职位封面图保存到本地
432 $job_cover = $dir.'/cover_'.$job_id.'.png'; 432 $job_cover = $dir.'/cover_'.$job_id.'.png';
433 file_put_contents($job_cover,file_get_contents($job['cover'])); 433 file_put_contents($job_cover,file_get_contents($job['cover']));
@@ -690,17 +690,17 @@ class User extends Api @@ -690,17 +690,17 @@ class User extends Api
690 mkdir($dir,0777,true); 690 mkdir($dir,0777,true);
691 } 691 }
692 692
693 - // // 用户小程序码  
694 - // $qrcode = $dir.'/qrcode_'.$user['id'].'.png';  
695 - // if(!file_exists($qrcode)){  
696 - // $response = Wechat::miniProgram()->app_code->getUnlimit($user['id'], [  
697 - // 'page' => 'pages/verificationPage/verificationPage',  
698 - // 'width' => 169,  
699 - // ]);  
700 - // if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {  
701 - // $response->saveAs($dir, str_replace($dir.'/','',$qrcode));  
702 - // }  
703 - // } 693 + // 用户小程序码
  694 + $qrcode = $dir.'/qrcode_'.$user['id'].'.png';
  695 + if(!file_exists($qrcode)){
  696 + $response = Wechat::miniProgram()->app_code->getUnlimit($user['id'], [
  697 + 'page' => 'pages/indexone/indexone',
  698 + 'width' => 169,
  699 + ]);
  700 + if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
  701 + $response->saveAs($dir, str_replace($dir.'/','',$qrcode));
  702 + }
  703 + }
704 704
705 //将用户头像保存到本地 705 //将用户头像保存到本地
706 $avatar = $dir.'/avatar_'.$user['id'].'.png'; 706 $avatar = $dir.'/avatar_'.$user['id'].'.png';