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

4

@@ -212,7 +212,7 @@ class SalesmangoodsController extends WeChatBaseController{ @@ -212,7 +212,7 @@ class SalesmangoodsController extends WeChatBaseController{
212 212
213 public function text(){ 213 public function text(){
214 214
215 - dump(cache('msgsss')); 215 + dump(cache('msgssss'));
216 216
217 } 217 }
218 218
@@ -225,6 +225,7 @@ class SalesmangoodsController extends WeChatBaseController{ @@ -225,6 +225,7 @@ class SalesmangoodsController extends WeChatBaseController{
225 $filepath = $_POST['mediaId'];//文件的绝对路径 225 $filepath = $_POST['mediaId'];//文件的绝对路径
226 $str = date('YmdHis').mt_rand('100','999').'.jpg'; 226 $str = date('YmdHis').mt_rand('100','999').'.jpg';
227 $targetName = '/uploads/'.$str; 227 $targetName = '/uploads/'.$str;
  228 + cache('msgssss',$targetName);
228 $ch = curl_init("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath"); 229 $ch = curl_init("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");
229 $fp = fopen($targetName, 'wb'); 230 $fp = fopen($targetName, 'wb');
230 curl_setopt($ch, CURLOPT_FILE, $fp); 231 curl_setopt($ch, CURLOPT_FILE, $fp);
@@ -233,7 +234,7 @@ class SalesmangoodsController extends WeChatBaseController{ @@ -233,7 +234,7 @@ class SalesmangoodsController extends WeChatBaseController{
233 $msg["filename"] = $str; 234 $msg["filename"] = $str;
234 curl_close($ch); 235 curl_close($ch);
235 fclose($fp); 236 fclose($fp);
236 - cache('msgsss',$targetName); 237 +
237 return json_encode($msg); 238 return json_encode($msg);
238 239
239 } 240 }