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

4

@@ -210,18 +210,6 @@ class SalesmangoodsController extends WeChatBaseController{ @@ -210,18 +210,6 @@ class SalesmangoodsController extends WeChatBaseController{
210 210
211 } 211 }
212 212
213 - public function text(){  
214 -  
215 - dump(cache('__FILE__'));  
216 - dump(cache('2222'));  
217 - dump(cache('pppp'));  
218 - dump(cache('ppp'));  
219 - dump(cache('oop'));  
220 - dump(cache('iip'));  
221 - dump(cache('uup'));  
222 -  
223 - }  
224 -  
225 /** 213 /**
226 * 上传图片 214 * 上传图片
227 */ 215 */
@@ -231,26 +219,12 @@ class SalesmangoodsController extends WeChatBaseController{ @@ -231,26 +219,12 @@ class SalesmangoodsController extends WeChatBaseController{
231 $filepath = $_POST['mediaId']; 219 $filepath = $_POST['mediaId'];
232 $str = 'uploads/'.date('YmdHis').time().rand('1000000','99999999').'.png'; 220 $str = 'uploads/'.date('YmdHis').time().rand('1000000','99999999').'.png';
233 $targetName = $str; 221 $targetName = $str;
234 - cache('urll',$targetName);  
235 $access_token = $access_token['accessToken']; 222 $access_token = $access_token['accessToken'];
236 $file = file_get_contents("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath"); 223 $file = file_get_contents("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");
237 cache('2222',$file); 224 cache('2222',$file);
238 cache('__FILE__',__FILE__); 225 cache('__FILE__',__FILE__);
239 file_put_contents($targetName,$file); 226 file_put_contents($targetName,$file);
240 -  
241 - /* $ch = curl_init("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");  
242 - cache('pppp',$ch);  
243 - $fp = fopen($targetName, 'w');  
244 - cache('oop',111);  
245 - curl_setopt($ch, CURLOPT_FILE, $fp);  
246 - cache('iip',111);  
247 - curl_setopt($ch, CURLOPT_HEADER, 0);  
248 - cache('uup',111);  
249 - $msg["status"] = curl_exec($ch);*/  
250 $msg["filename"] = $str; 227 $msg["filename"] = $str;
251 - /*curl_close($ch);  
252 - fclose($fp);*/  
253 -  
254 return json_encode($msg); 228 return json_encode($msg);
255 229
256 } 230 }