...
|
...
|
@@ -338,19 +338,39 @@ class Lists extends Api |
|
|
->where('id',$id)
|
|
|
->field('updatetime',true)
|
|
|
->find();
|
|
|
if(!empty($data['file'])){
|
|
|
$base_url = $data['file'];
|
|
|
$qiniu_url = $qiniu.$data['file'];
|
|
|
$a = file_get_contents($qiniu_url);
|
|
|
$path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
if(!file_exists($path)) {
|
|
|
mkdir($path,0777,true);
|
|
|
// if(!empty($data['file'])){
|
|
|
// $base_url = $data['file'];
|
|
|
// $qiniu_url = $qiniu.$data['file'];
|
|
|
// $a = file_get_contents($qiniu_url);
|
|
|
// $path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
// if(!file_exists($path)) {
|
|
|
// mkdir($path,0777,true);
|
|
|
// }
|
|
|
// file_put_contents('.'.$base_url,$a);
|
|
|
// $data['file'] = request()->domain().$base_url;
|
|
|
// }else{
|
|
|
// $data['file'] = '';
|
|
|
// }
|
|
|
$file_list = Db::name('information_file')
|
|
|
->where('information_id',$id)
|
|
|
->field('file_name,file')
|
|
|
->select();
|
|
|
foreach ($file_list as &$v){
|
|
|
if(!empty($v['file'])){
|
|
|
$base_url = $v['file'];
|
|
|
$qiniu_url = $qiniu.$v['file'];
|
|
|
$a = file_get_contents($qiniu_url);
|
|
|
$path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
if(!file_exists($path)) {
|
|
|
mkdir($path,0777,true);
|
|
|
}
|
|
|
file_put_contents('.'.$base_url,$a);
|
|
|
$v['file'] = request()->domain().$base_url;
|
|
|
}else{
|
|
|
$v['file'] = '';
|
|
|
}
|
|
|
file_put_contents('.'.$base_url,$a);
|
|
|
$data['file'] = request()->domain().$base_url;
|
|
|
}else{
|
|
|
$data['file'] = '';
|
|
|
}
|
|
|
$data['file_list'] = $file_list;
|
|
|
$data['createtime'] = date('Y-m-d H:i:s',$data['createtime']);
|
|
|
$this->success('success',$data);
|
|
|
}
|
...
|
...
|
@@ -390,19 +410,39 @@ class Lists extends Api |
|
|
->where('id',$id)
|
|
|
->field('updatetime',true)
|
|
|
->find();
|
|
|
if(!empty($data['file'])){
|
|
|
$base_url = $data['file'];
|
|
|
$qiniu_url = $qiniu.$data['file'];
|
|
|
$a = file_get_contents($qiniu_url);
|
|
|
$path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
if(!file_exists($path)) {
|
|
|
mkdir($path,0777,true);
|
|
|
// if(!empty($data['file'])){
|
|
|
// $base_url = $data['file'];
|
|
|
// $qiniu_url = $qiniu.$data['file'];
|
|
|
// $a = file_get_contents($qiniu_url);
|
|
|
// $path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
// if(!file_exists($path)) {
|
|
|
// mkdir($path,0777,true);
|
|
|
// }
|
|
|
// file_put_contents('.'.$base_url,$a);
|
|
|
// $data['file'] = request()->domain().$base_url;
|
|
|
// }else{
|
|
|
// $data['file'] = '';
|
|
|
// }
|
|
|
$file_list = Db::name('policy_file')
|
|
|
->where('policy_id',$id)
|
|
|
->field('file_name,file')
|
|
|
->select();
|
|
|
foreach ($file_list as &$v){
|
|
|
if(!empty($v['file'])){
|
|
|
$base_url = $v['file'];
|
|
|
$qiniu_url = $qiniu.$v['file'];
|
|
|
$a = file_get_contents($qiniu_url);
|
|
|
$path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
if(!file_exists($path)) {
|
|
|
mkdir($path,0777,true);
|
|
|
}
|
|
|
file_put_contents('.'.$base_url,$a);
|
|
|
$v['file'] = request()->domain().$base_url;
|
|
|
}else{
|
|
|
$v['file'] = '';
|
|
|
}
|
|
|
file_put_contents('.'.$base_url,$a);
|
|
|
$data['file'] = request()->domain().$base_url;
|
|
|
}else{
|
|
|
$data['file'] = '';
|
|
|
}
|
|
|
$data['file_list'] = $file_list;
|
|
|
$data['createtime'] = date('Y-m-d H:i:s',$data['createtime']);
|
|
|
$this->success('success',$data);
|
|
|
}
|
...
|
...
|
|