作者 李宇航

合并分支 'master-server' 到 'master'

gx修改上传图片翻译问题处理



查看合并请求 !944
@@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside; @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside;
12 use App\Enums\Common\Code; 12 use App\Enums\Common\Code;
13 use App\Http\Logic\Bside\News\NewsLogic; 13 use App\Http\Logic\Bside\News\NewsLogic;
14 use App\Models\Channel\Channel; 14 use App\Models\Channel\Channel;
  15 +use App\Models\CustomModule\CustomModuleCategory;
15 use App\Models\CustomModule\CustomModuleContent; 16 use App\Models\CustomModule\CustomModuleContent;
16 use App\Models\CustomModule\CustomModuleExtentContent; 17 use App\Models\CustomModule\CustomModuleExtentContent;
17 use App\Models\Domain\DomainInfo; 18 use App\Models\Domain\DomainInfo;
@@ -79,6 +80,11 @@ DSE1504F,Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positive,150,1.4, @@ -79,6 +80,11 @@ DSE1504F,Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positive,150,1.4,
79 'operator_id'=>6393, 80 'operator_id'=>6393,
80 'module_id'=>2, 81 'module_id'=>2,
81 ]; 82 ];
  83 + $customModuleCategoryModel = new CustomModuleCategory();
  84 + $catInfo = $customModuleCategoryModel->read(['name'=>$array1[1]]);
  85 + if($catInfo !== false){
  86 + $contentData['category_id'] = $catInfo['id'];
  87 + }
82 $customModuleContentModel = new CustomModuleContent(); 88 $customModuleContentModel = new CustomModuleContent();
83 $contentId = $customModuleContentModel->addReturnId($contentData); 89 $contentId = $customModuleContentModel->addReturnId($contentData);
84 $route = RouteMap::setRoute($array1[0],RouteMap::SOURCE_MODULE,$contentId,2837); 90 $route = RouteMap::setRoute($array1[0],RouteMap::SOURCE_MODULE,$contentId,2837);
@@ -234,8 +234,8 @@ class ImageController extends Controller @@ -234,8 +234,8 @@ class ImageController extends Controller
234 $tran_name = $tran_name[0]; 234 $tran_name = $tran_name[0];
235 } 235 }
236 $enName = generateRoute($tran_name); 236 $enName = generateRoute($tran_name);
237 - if(substr($enName, 0, 1) === '-'){  
238 - $enName = md5(uniqid().$project_id.rand(1,1000));; 237 + if(substr($enName, 0, 1) === '-' || empty($enName)){
  238 + $enName = md5(uniqid().$project_id.rand(1,1000));
239 } 239 }
240 $fileName = $enName; 240 $fileName = $enName;
241 $i=1; 241 $i=1;