作者 何书鹏
1 个管道 的构建 通过 耗费 0 秒

1

... ... @@ -104,32 +104,28 @@ class Notify extends Api
}
/**
* 七牛云通知回调
* 七牛云音频转码通知回调
* @ApiInternal
*/
public function notifyQiniu()
public function notifyQiniuAvthumb()
{
if($this->request->isPost()) {
$arr = $this->request->param();
Db::name('ceshi')->insert(['content'=>json_encode($arr,JSON_UNESCAPED_UNICODE)]);
// 判断七牛云回调code是否为完成
if(isset($arr['code']) && $arr['code'] == 0) {
$url = '/' . $arr['key'];
$url = '/' . $arr['items'][0]['key'];
$info = Attachment::get(['url'=>$url]);
Db::name('ceshi')->insert(['content'=>$info ? '有' : '无']);
if(!$info){
$admin_id = isset($arr['admin']) ? $arr['admin'] : 0;
$user_id = isset($arr['user']) ? $arr['user'] : 0;
$imageInfo = json_decode($arr['imageInfo'], true);
$params = array(
'admin_id' => (int)$admin_id,
'user_id' => (int)$user_id,
'filesize' => $arr['filesize'],
'imagewidth' => isset($imageInfo['width']) ? $imageInfo['width'] : 0,
'imageheight' => isset($imageInfo['height']) ? $imageInfo['height'] : 0,
'imagetype' => isset($imageInfo['format']) ? $imageInfo['format'] : '',
'imageframes' => 1,
'mimetype' => "image/" . (isset($imageInfo['format']) ? $imageInfo['format'] : ''),
'admin_id' => 0,
'user_id' => 0,
'filesize' => 0,
'imagewidth' => 0,
'imageheight' => 0,
'imagetype' => 'pcm',
'imageframes' => 0,
'mimetype' => 'application/octet-stream',
'extparam' => '',
'url' => $url,
'uploadtime' => time(),
... ... @@ -141,6 +137,5 @@ class Notify extends Api
}
return json(['ret' => 'failed']);
}
return json(['ret' => 'failed']);
}
}
\ No newline at end of file
... ...