作者 anyv
1 个管道 的构建 通过 耗费 0 秒

4

@@ -218,8 +218,8 @@ class SalesmangoodsController extends WeChatBaseController{ @@ -218,8 +218,8 @@ class SalesmangoodsController extends WeChatBaseController{
218 $access_token=$this->getAccessToken(); 218 $access_token=$this->getAccessToken();
219 $filepath = $_POST['mediaId'];//文件的绝对路径 219 $filepath = $_POST['mediaId'];//文件的绝对路径
220 $str = date('YmdHis').random(12).'.jpg'; 220 $str = date('YmdHis').random(12).'.jpg';
221 - $targetName = '/uploads/'.date(Ymd).'/'.$str;  
222 - $ch = curl_int("https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=".$access_token."&media_id=".$filepath); 221 + $targetName = '/uploads/'.date('Ymd').'/'.$str;
  222 + $ch = curl_int("https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=$access_token&media_id=$filepath");
223 $fp = fopen($targetName, 'wb'); 223 $fp = fopen($targetName, 'wb');
224 curl_setopt($ch, CURLOPT_FILE, $fp); 224 curl_setopt($ch, CURLOPT_FILE, $fp);
225 curl_setopt($ch, CURLOPT_HEADER, 0); 225 curl_setopt($ch, CURLOPT_HEADER, 0);