作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -110,7 +110,12 @@ class FileController @@ -110,7 +110,12 @@ class FileController
110 $name = $files->getClientOriginalName(); 110 $name = $files->getClientOriginalName();
111 //查看文件是否存在 111 //查看文件是否存在
112 $fileModel = new File(); 112 $fileModel = new File();
113 - $file_hash = $fileModel->read(['hash'=>$hash]); 113 + //查看图片是否已上传
  114 + $param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0];
  115 + if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
  116 + $param['project_id'] = $this->cache['project_id'];
  117 + }
  118 + $file_hash = $fileModel->read($param);
114 if($file_hash !== false){ 119 if($file_hash !== false){
115 return $this->response('资源',Code::SUCCESS,$this->responseData($file_hash['path'], $name)); 120 return $this->response('资源',Code::SUCCESS,$this->responseData($file_hash['path'], $name));
116 } 121 }
@@ -170,7 +175,11 @@ class FileController @@ -170,7 +175,11 @@ class FileController
170 $fileModel = new File(); 175 $fileModel = new File();
171 $name = $file->getClientOriginalName(); 176 $name = $file->getClientOriginalName();
172 $hash = hash_file('md5', $file->getPathname()); 177 $hash = hash_file('md5', $file->getPathname());
173 - $file_hash = $fileModel->read(['hash'=>$hash]); 178 + $param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0];
  179 + if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
  180 + $param['project_id'] = $this->cache['project_id'];
  181 + }
  182 + $file_hash = $fileModel->read($param);
174 if($file_hash !== false){ 183 if($file_hash !== false){
175 $data[] = $this->responseData($file_hash['path'], $name); 184 $data[] = $this->responseData($file_hash['path'], $name);
176 continue; 185 continue;