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

74

... ... @@ -212,11 +212,11 @@ class SalesmangoodsController extends WeChatBaseController{
public function text(){
dump(cache('gg'));
dump(cache('pp'));
dump(cache('oo'));
dump(cache('ii'));
dump(cache('uu'));
dump(cache('ggp'));
dump(cache('ppp'));
dump(cache('oop'));
dump(cache('iip'));
dump(cache('uup'));
}
... ... @@ -229,15 +229,15 @@ class SalesmangoodsController extends WeChatBaseController{
$filepath = $_POST['mediaId'];//文件的绝对路径
$str = date('YmdHis').mt_rand('100','999').'.jpg';
$targetName = '/uploads/'.$str;
cache('gg',111);
cache('ggp',111);
$ch = curl_init("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");
cache('pp',111);
cache('ppp',111);
$fp = fopen($targetName, 'wb');
cache('oo',111);
cache('oop',111);
curl_setopt($ch, CURLOPT_FILE, $fp);
cache('ii',111);
cache('iip',111);
curl_setopt($ch, CURLOPT_HEADER, 0);
cache('uu',111);
cache('uup',111);
$msg["status"] = curl_exec($ch);
$msg["filename"] = $str;
curl_close($ch);
... ...