|
@@ -258,11 +258,7 @@ class ImageController extends Controller |
|
@@ -258,11 +258,7 @@ class ImageController extends Controller |
|
258
|
*/
|
258
|
*/
|
|
259
|
public function onlyName($enName,$project_id){
|
259
|
public function onlyName($enName,$project_id){
|
|
260
|
$imageModel = new ImageModel();
|
260
|
$imageModel = new ImageModel();
|
|
261
|
- if(empty($project_id)){
|
|
|
|
262
|
- $info = $imageModel->read(['en_name' => $enName]);
|
|
|
|
263
|
- }else{
|
|
|
|
264
|
- $info = $imageModel->read(['project_id' => $project_id, 'en_name' => $enName]);
|
|
|
|
265
|
- }
|
261
|
+ $info = $imageModel->read(['project_id' => $project_id, 'en_name' => $enName]);
|
|
266
|
if($info !== false){
|
262
|
if($info !== false){
|
|
267
|
return true;
|
263
|
return true;
|
|
268
|
}
|
264
|
}
|
|
@@ -290,6 +286,9 @@ class ImageController extends Controller |
|
@@ -290,6 +286,9 @@ class ImageController extends Controller |
|
290
|
* @time :2023/7/19 16:38
|
286
|
* @time :2023/7/19 16:38
|
|
291
|
*/
|
287
|
*/
|
|
292
|
public function saveMysql(&$imageModel,$size,$image_type,$fileName,$hash,$is_cos = 0,$mime = '', $name=''){
|
288
|
public function saveMysql(&$imageModel,$size,$image_type,$fileName,$hash,$is_cos = 0,$mime = '', $name=''){
|
|
|
|
289
|
+ if(strpos($mime, 'image') !== false){
|
|
|
|
290
|
+
|
|
|
|
291
|
+ }
|
|
293
|
$data = [
|
292
|
$data = [
|
|
294
|
'path' => $this->path.'/'.$fileName,
|
293
|
'path' => $this->path.'/'.$fileName,
|
|
295
|
'created_at' => date('Y-m-d H:i:s',time()),
|
294
|
'created_at' => date('Y-m-d H:i:s',time()),
|
|
@@ -514,6 +513,9 @@ class ImageController extends Controller |
|
@@ -514,6 +513,9 @@ class ImageController extends Controller |
|
514
|
//A端上传
|
513
|
//A端上传
|
|
515
|
if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
|
514
|
if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
|
|
516
|
$this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m');
|
515
|
$this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m');
|
|
|
|
516
|
+ if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
|
|
|
|
517
|
+ $this->path = $this->path.'/'.$this->cache['project_id'];
|
|
|
|
518
|
+ }
|
|
517
|
}else{
|
519
|
}else{
|
|
518
|
//TODO::设置上传文件大小(B端上传)
|
520
|
//TODO::设置上传文件大小(B端上传)
|
|
519
|
$max = config('upload.default_b_image')['size']['max'];
|
521
|
$max = config('upload.default_b_image')['size']['max'];
|