作者 lyh

变更数据

... ... @@ -12,6 +12,7 @@ use App\Services\CosService;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Cache;
use function RingCentral\Psr7\str;
class FileController
{
... ... @@ -365,7 +366,10 @@ class FileController
public function setUrl(){
//A端上传
if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
$this->path = $this->uploads['path_a'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m');
$this->path = $this->uploads['path_a'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m');
if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
$this->path = $this->path.'/'.$this->cache['project_id'];
}
}else{
//B端上传,upload_method 为 1时 强制上传到本地
if(!isset($this->param['upload_method'])) {
... ...
... ... @@ -258,11 +258,7 @@ class ImageController extends Controller
*/
public function onlyName($enName,$project_id){
$imageModel = new ImageModel();
if(empty($project_id)){
$info = $imageModel->read(['en_name' => $enName]);
}else{
$info = $imageModel->read(['project_id' => $project_id, 'en_name' => $enName]);
}
$info = $imageModel->read(['project_id' => $project_id, 'en_name' => $enName]);
if($info !== false){
return true;
}
... ... @@ -290,6 +286,9 @@ class ImageController extends Controller
* @time :2023/7/19 16:38
*/
public function saveMysql(&$imageModel,$size,$image_type,$fileName,$hash,$is_cos = 0,$mime = '', $name=''){
if(strpos($mime, 'image') !== false){
}
$data = [
'path' => $this->path.'/'.$fileName,
'created_at' => date('Y-m-d H:i:s',time()),
... ... @@ -514,6 +513,9 @@ class ImageController extends Controller
//A端上传
if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
$this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m');
if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
$this->path = $this->path.'/'.$this->cache['project_id'];
}
}else{
//TODO::设置上传文件大小(B端上传)
$max = config('upload.default_b_image')['size']['max'];
... ...