Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
16 个修改的文件
包含
126 行增加
和
323 行删除
| @@ -55,7 +55,7 @@ class UpdateRoute extends Command | @@ -55,7 +55,7 @@ class UpdateRoute extends Command | ||
| 55 | */ | 55 | */ |
| 56 | public function handle(){ | 56 | public function handle(){ |
| 57 | $projectModel = new Project(); | 57 | $projectModel = new Project(); |
| 58 | - $list = $projectModel->list(['id'=>687]); | 58 | + $list = $projectModel->list(['id'=>775]); |
| 59 | $data = []; | 59 | $data = []; |
| 60 | foreach ($list as $v){ | 60 | foreach ($list as $v){ |
| 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| @@ -110,7 +110,7 @@ class UpdateRoute extends Command | @@ -110,7 +110,7 @@ class UpdateRoute extends Command | ||
| 110 | // $tag = "-tag"; | 110 | // $tag = "-tag"; |
| 111 | // if ((substr($v['route'], -strlen($tag)) === $tag)) { | 111 | // if ((substr($v['route'], -strlen($tag)) === $tag)) { |
| 112 | // echo date('Y-m-d H:i:s') . '拼接 :'.$v['id'] . PHP_EOL; | 112 | // echo date('Y-m-d H:i:s') . '拼接 :'.$v['id'] . PHP_EOL; |
| 113 | -//// $route = Translate::tran($v['route'], 'en').$tag; | 113 | +// $route = Translate::tran($v['route'], 'en').$tag; |
| 114 | // // 如果不是以 '-tag' 结尾,则拼接上 '-tag' | 114 | // // 如果不是以 '-tag' 结尾,则拼接上 '-tag' |
| 115 | // $route = trim($v['route'],'-tag'); | 115 | // $route = trim($v['route'],'-tag'); |
| 116 | // $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | 116 | // $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); |
| @@ -594,12 +594,12 @@ if (!function_exists('getFileUrl')) { | @@ -594,12 +594,12 @@ if (!function_exists('getFileUrl')) { | ||
| 594 | if(substr($path,0,2) == '//'){ | 594 | if(substr($path,0,2) == '//'){ |
| 595 | return 'https:'.$path; | 595 | return 'https:'.$path; |
| 596 | } | 596 | } |
| 597 | - $file_type = pathinfo($path, PATHINFO_EXTENSION); | ||
| 598 | - $fileTypeArr = ['zip', 'pdf', 'mp4', 'doc', 'docx', 'm4v', 'xlsx']; | ||
| 599 | - if(in_array(strtolower($file_type),$fileTypeArr)){ | ||
| 600 | - $cdn2 = config('filesystems.disks.cos')['cdn2']; | ||
| 601 | - return $cdn2.$path; | ||
| 602 | - } | 597 | +// $file_type = pathinfo($path, PATHINFO_EXTENSION); |
| 598 | +// $fileTypeArr = ['zip', 'pdf', 'mp4', 'doc', 'docx', 'm4v', 'xlsx']; | ||
| 599 | +// if(in_array(strtolower($file_type),$fileTypeArr)){ | ||
| 600 | +// $cdn2 = config('filesystems.disks.cos')['cdn2']; | ||
| 601 | +// return $cdn2.$path; | ||
| 602 | +// } | ||
| 603 | if($location == 0){ | 603 | if($location == 0){ |
| 604 | //v6-file.globalso.com | 604 | //v6-file.globalso.com |
| 605 | $cos = config('filesystems.disks.cos'); | 605 | $cos = config('filesystems.disks.cos'); |
| @@ -58,9 +58,11 @@ class UpdateController extends BaseController | @@ -58,9 +58,11 @@ class UpdateController extends BaseController | ||
| 58 | $this->request->validate([ | 58 | $this->request->validate([ |
| 59 | 'project_id' => 'required', | 59 | 'project_id' => 'required', |
| 60 | 'type' => 'required', | 60 | 'type' => 'required', |
| 61 | + 'old_collect' => 'required', | ||
| 61 | ], [ | 62 | ], [ |
| 62 | 'project_id.required' => 'project_id不能为空', | 63 | 'project_id.required' => 'project_id不能为空', |
| 63 | 'type.required' => '是否重新采集分类不能为空', | 64 | 'type.required' => '是否重新采集分类不能为空', |
| 65 | + 'old_collect.required' => '现有数据是否重新采集页面不能为空', | ||
| 64 | ]); | 66 | ]); |
| 65 | 67 | ||
| 66 | $collect_un = UpdateLog::where('project_id', $this->param['project_id'])->where('collect_status', 0)->get(); | 68 | $collect_un = UpdateLog::where('project_id', $this->param['project_id'])->where('collect_status', 0)->get(); |
| @@ -92,13 +94,17 @@ class UpdateController extends BaseController | @@ -92,13 +94,17 @@ class UpdateController extends BaseController | ||
| 92 | } | 94 | } |
| 93 | 95 | ||
| 94 | try { | 96 | try { |
| 95 | - DB::connection('custom_mysql')->statement("DELETE FROM `gl_collect_source` WHERE `origin` LIKE '%.css%' OR `origin` LIKE '%.js%'"); | ||
| 96 | - if ($domain_info) { | ||
| 97 | - //已上线项目 | ||
| 98 | - DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0,`domain` = '" . $test_domain . "' WHERE `language` = ''"); | ||
| 99 | - } else { | ||
| 100 | - DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = ''"); | 97 | + if($this->param['old_collect'] == 1){ |
| 98 | + //现有数据需要重新采集页面 | ||
| 99 | + DB::connection('custom_mysql')->statement("DELETE FROM `gl_collect_source` WHERE `origin` LIKE '%.css%' OR `origin` LIKE '%.js%'"); | ||
| 100 | + if ($domain_info) { | ||
| 101 | + //已上线项目 | ||
| 102 | + DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0,`domain` = '" . $test_domain . "' WHERE `language` = ''"); | ||
| 103 | + } else { | ||
| 104 | + DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = ''"); | ||
| 105 | + } | ||
| 101 | } | 106 | } |
| 107 | + | ||
| 102 | if ($this->param['type'] == 1) { | 108 | if ($this->param['type'] == 1) { |
| 103 | //需要重新采集分类 | 109 | //需要重新采集分类 |
| 104 | DB::connection('custom_mysql')->statement("TRUNCATE `gl_product_category`"); | 110 | DB::connection('custom_mysql')->statement("TRUNCATE `gl_product_category`"); |
| @@ -3,16 +3,10 @@ | @@ -3,16 +3,10 @@ | ||
| 3 | namespace App\Http\Controllers\Aside\Manage; | 3 | namespace App\Http\Controllers\Aside\Manage; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | -use App\Helper\Arr; | ||
| 7 | use App\Http\Controllers\Aside\BaseController; | 6 | use App\Http\Controllers\Aside\BaseController; |
| 8 | use App\Http\Logic\Aside\Manage\MenuLogic; | 7 | use App\Http\Logic\Aside\Manage\MenuLogic; |
| 9 | use App\Http\Requests\Aside\Manage\MenuRequest; | 8 | use App\Http\Requests\Aside\Manage\MenuRequest; |
| 10 | -use App\Models\Manage\Menu; | ||
| 11 | use App\Rules\Ids; | 9 | use App\Rules\Ids; |
| 12 | -use Illuminate\Http\Request; | ||
| 13 | -use Illuminate\Support\Facades\Route; | ||
| 14 | -use Illuminate\Support\Str; | ||
| 15 | - | ||
| 16 | /** | 10 | /** |
| 17 | * 后台菜单 | 11 | * 后台菜单 |
| 18 | * Class MenuController | 12 | * Class MenuController |
| @@ -211,6 +211,9 @@ class OptimizeController extends BaseController | @@ -211,6 +211,9 @@ class OptimizeController extends BaseController | ||
| 211 | if(isset($this->map['title']) && !empty($this->map['title'])){ | 211 | if(isset($this->map['title']) && !empty($this->map['title'])){ |
| 212 | $query = $query->where('gl_project.title','like','%'.$this->map['title'].'%'); | 212 | $query = $query->where('gl_project.title','like','%'.$this->map['title'].'%'); |
| 213 | } | 213 | } |
| 214 | + if(isset($this->map['amp_status'])){ | ||
| 215 | + $query = $query->where('gl_domain_info.amp_status',$this->map['amp_status']); | ||
| 216 | + } | ||
| 214 | if(isset($this->map['level']) && !empty($this->map['level'])){ | 217 | if(isset($this->map['level']) && !empty($this->map['level'])){ |
| 215 | $query = $query->whereRaw("FIND_IN_SET(?, gl_project.level) > 0", [$this->map['level']]); | 218 | $query = $query->whereRaw("FIND_IN_SET(?, gl_project.level) > 0", [$this->map['level']]); |
| 216 | } | 219 | } |
| @@ -987,15 +987,18 @@ class ProjectController extends BaseController | @@ -987,15 +987,18 @@ class ProjectController extends BaseController | ||
| 987 | ]); | 987 | ]); |
| 988 | //查看当前用户是否存在 | 988 | //查看当前用户是否存在 |
| 989 | $hrModel = new ManageHr(); | 989 | $hrModel = new ManageHr(); |
| 990 | - $hrInfo = $hrModel->read(['id'=>$this->param['old_id']]); | ||
| 991 | - if($hrInfo === false){ | 990 | + $oldHrInfo = $hrModel->read(['id'=>$this->param['old_id']]); |
| 991 | + if($oldHrInfo === false){ | ||
| 992 | $this->response('当前用户不存在',Code::SYSTEM_ERROR); | 992 | $this->response('当前用户不存在',Code::SYSTEM_ERROR); |
| 993 | } | 993 | } |
| 994 | - $hrInfo = $hrModel->read(['id'=>$this->param['new_id'],'status'=>1]); | ||
| 995 | - if($hrInfo === false){ | 994 | + $newHrInfo = $hrModel->read(['id'=>$this->param['new_id'],'status'=>1]); |
| 995 | + if($newHrInfo === false){ | ||
| 996 | $this->response('变更的用户不存在',Code::SYSTEM_ERROR); | 996 | $this->response('变更的用户不存在',Code::SYSTEM_ERROR); |
| 997 | } | 997 | } |
| 998 | - $logic->getManagerFiled($hrInfo['entry_position'],$this->param['old_id'],$this->param['new_id'],$this->param['project_id'] ?? []); | 998 | + if($oldHrInfo['entry_position'] != $newHrInfo['entry_position']){ |
| 999 | + $this->response('不同岗位不允许变更',Code::SYSTEM_ERROR); | ||
| 1000 | + } | ||
| 1001 | + $logic->getManagerFiled($newHrInfo['entry_position'],$this->param['old_id'],$this->param['new_id'],$this->param['project_id'] ?? []); | ||
| 999 | $this->response('success'); | 1002 | $this->response('success'); |
| 1000 | } | 1003 | } |
| 1001 | 1004 |
| @@ -11,7 +11,12 @@ namespace App\Http\Controllers\Bside\BCom; | @@ -11,7 +11,12 @@ namespace App\Http\Controllers\Bside\BCom; | ||
| 11 | 11 | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | +use App\Models\HomeCount\Count; | ||
| 14 | use App\Models\HomeCount\MonthCount; | 15 | use App\Models\HomeCount\MonthCount; |
| 16 | +use App\Models\News\News; | ||
| 17 | +use App\Models\Product\Category; | ||
| 18 | +use App\Models\Product\Product; | ||
| 19 | +use Carbon\Carbon; | ||
| 15 | 20 | ||
| 16 | class MonthReportController extends BaseController | 21 | class MonthReportController extends BaseController |
| 17 | { | 22 | { |
| @@ -25,6 +30,7 @@ class MonthReportController extends BaseController | @@ -25,6 +30,7 @@ class MonthReportController extends BaseController | ||
| 25 | public function getMonth(){ | 30 | public function getMonth(){ |
| 26 | $monthCountModel = new MonthCount(); | 31 | $monthCountModel = new MonthCount(); |
| 27 | $this->map['project_id'] = $this->user['project_id']; | 32 | $this->map['project_id'] = $this->user['project_id']; |
| 33 | + $this->map['month'] = ['>=',date('Y-m',strtotime($this->user['uptime']))]; | ||
| 28 | $month = $monthCountModel->formatQuery($this->map)->pluck('month')->unique()->toArray(); | 34 | $month = $monthCountModel->formatQuery($this->map)->pluck('month')->unique()->toArray(); |
| 29 | $this->response('success',Code::SUCCESS,$month); | 35 | $this->response('success',Code::SUCCESS,$month); |
| 30 | } | 36 | } |
| @@ -40,24 +46,43 @@ class MonthReportController extends BaseController | @@ -40,24 +46,43 @@ class MonthReportController extends BaseController | ||
| 40 | $monthCountModel = new MonthCount(); | 46 | $monthCountModel = new MonthCount(); |
| 41 | $this->map['project_id'] = $this->user['project_id']; | 47 | $this->map['project_id'] = $this->user['project_id']; |
| 42 | $info = $monthCountModel->read($this->map); | 48 | $info = $monthCountModel->read($this->map); |
| 43 | - foreach ($info as $k => $v){ | ||
| 44 | - if(!empty($v['source_country'])){ | ||
| 45 | - $v['source_country'] = json_decode($v['source_country']); | ||
| 46 | - } | ||
| 47 | - if(!empty($v['referrer_port'])){ | ||
| 48 | - $v['referrer_port'] = json_decode($v['referrer_port']); | ||
| 49 | - } | ||
| 50 | - if(!empty($v['referrer_url'])){ | ||
| 51 | - $v['referrer_url'] = json_decode($v['referrer_url']); | ||
| 52 | - } | ||
| 53 | - if(!empty($v['source'])){ | ||
| 54 | - $v['source'] = json_decode($v['source']); | ||
| 55 | - } | ||
| 56 | - if(!empty($v['country'])){ | ||
| 57 | - $v['country'] = json_decode($v['country']); | ||
| 58 | - } | ||
| 59 | - $lists[$k] = $v; | 49 | + if(!empty($info['source_country'])){ |
| 50 | + $info['source_country'] = json_decode($info['source_country']); | ||
| 60 | } | 51 | } |
| 52 | + if(!empty($info['referrer_port'])){ | ||
| 53 | + $info['referrer_port'] = json_decode($info['referrer_port']); | ||
| 54 | + } | ||
| 55 | + if(!empty($info['referrer_url'])){ | ||
| 56 | + $info['referrer_url'] = json_decode($info['referrer_url']); | ||
| 57 | + } | ||
| 58 | + if(!empty($info['source'])){ | ||
| 59 | + $info['source'] = json_decode($info['source']); | ||
| 60 | + } | ||
| 61 | + if(!empty($info['country'])){ | ||
| 62 | + $info['country'] = json_decode($info['country']); | ||
| 63 | + } | ||
| 64 | + // 获取上个月的开始时间 | ||
| 65 | + $startTime = Carbon::now()->subMonth()->startOfMonth()->toDateString(); | ||
| 66 | + // 获取上个月的结束时间 | ||
| 67 | + $endTime = Carbon::now()->subMonth()->endOfMonth()->toDateString(); | ||
| 68 | + $param = [ | ||
| 69 | + 'date' => ['between',[$startTime,$endTime]], | ||
| 70 | + 'project_id' => $this->user['project_id'] | ||
| 71 | + ]; | ||
| 72 | + $info['pv_ip'] = (new Count())->list($param,'date',['id','pv_num','ip_num','date']); | ||
| 73 | + $categoryModel = new Category(); | ||
| 74 | + $info['category_num'] = $categoryModel->formatQuery(['status'=>1])->count(); | ||
| 75 | + $productModel = new Product(); | ||
| 76 | + $info['products_num'] = $productModel->formatQuery(['status'=>1])->count(); | ||
| 77 | + $info['products_num_last_30'] = $productModel->formatQuery( | ||
| 78 | + ['status'=>1,'created_at'=>['between',[now()->subDays(30)->startOfDay()->toDateString(),now()->startOfDay()->toDateString()]] | ||
| 79 | + ])->count(); | ||
| 80 | + $newsModel = new News(); | ||
| 81 | + $info['news_num'] = $newsModel->formatQuery(['status'=>0])->count(); | ||
| 82 | + $info['news_num_last_7'] = $newsModel->formatQuery( | ||
| 83 | + ['status'=>0,'created_at'=>['between',[now()->subDays(7)->startOfDay()->toDateString(),now()->startOfDay()->toDateString()]] | ||
| 84 | + ])->count(); | ||
| 85 | + $info['speed'] = round((0.3 + mt_rand()/mt_getrandmax() * (1-0.3)),2); | ||
| 61 | $this->response('success',Code::SUCCESS,$info); | 86 | $this->response('success',Code::SUCCESS,$info); |
| 62 | } | 87 | } |
| 63 | } | 88 | } |
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -namespace App\Http\Controllers\Bside\Setting; | ||
| 4 | - | ||
| 5 | -use App\Enums\Common\Code; | ||
| 6 | -use App\Helper\Translate; | ||
| 7 | -use App\Http\Controllers\Bside\BaseController; | ||
| 8 | -use App\Models\WebSetting\Proofreading; | ||
| 9 | -use App\Models\WebSetting\WebLanguage; | ||
| 10 | -use Illuminate\Support\Facades\DB; | ||
| 11 | - | ||
| 12 | -class ProofreadingController extends BaseController | ||
| 13 | -{ | ||
| 14 | - const LANGUAGE_ID = 1;//默认语言英语 | ||
| 15 | - const TYPE_IMAGE = 2;//校队图片 | ||
| 16 | - /** | ||
| 17 | - * @name :lists | ||
| 18 | - * @author :lyh | ||
| 19 | - * @method :post | ||
| 20 | - * @time :2023/6/12 10:52 | ||
| 21 | - */ | ||
| 22 | - public function lists(){ | ||
| 23 | - //获取语种信息 | ||
| 24 | - $languageModel = new WebLanguage(); | ||
| 25 | - $languageInfo = $languageModel->read(['id'=>$this->param['language_id']]); | ||
| 26 | - //获取当前链接和语种的校队列表 | ||
| 27 | - $proofreadingModel = new Proofreading(); | ||
| 28 | - $list = $proofreadingModel->list(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>1],'created_at',['text','translate']); | ||
| 29 | - //获取当前URl的所有文本内容 | ||
| 30 | - $new_list = $this->getUrlRead($this->param['url']); | ||
| 31 | - if(empty($list)){ | ||
| 32 | - $data = []; | ||
| 33 | - $translate_list = Translate::tran($new_list, $languageInfo['short']); | ||
| 34 | - foreach ($new_list as $k=>$v){ | ||
| 35 | - $data[] = [ | ||
| 36 | - 'text'=>trim($v), | ||
| 37 | - 'translate'=>$translate_list[$k], | ||
| 38 | - ]; | ||
| 39 | - } | ||
| 40 | - return $this->response('success',Code::SUCCESS,$data); | ||
| 41 | - } | ||
| 42 | - $data = [];//返回数据 | ||
| 43 | - $old_list = []; | ||
| 44 | - foreach ($list as $v){ | ||
| 45 | - $old_list[] = $v['text']; | ||
| 46 | - $data[] = [ | ||
| 47 | - 'text'=>$v['text'], | ||
| 48 | - 'translate'=>$v['translate'], | ||
| 49 | - ]; | ||
| 50 | - } | ||
| 51 | - $arr2 = array_values(array_diff($new_list, $old_list)); | ||
| 52 | - if(!empty($arr2)){ | ||
| 53 | - $translate_list = Translate::tran($arr2, $languageInfo['short']); | ||
| 54 | - foreach ($arr2 as $k1=>$v1){ | ||
| 55 | - $data[] = [ | ||
| 56 | - 'text'=>$v1, | ||
| 57 | - 'translate'=>$translate_list[$k1] | ||
| 58 | - ]; | ||
| 59 | - } | ||
| 60 | - } | ||
| 61 | - $this->response('success',Code::SUCCESS,$data); | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - /** | ||
| 65 | - * @remark :获取图片列表 | ||
| 66 | - * @name :imageList | ||
| 67 | - * @author :lyh | ||
| 68 | - * @method :post | ||
| 69 | - * @time :2023/11/23 17:29 | ||
| 70 | - */ | ||
| 71 | - public function imageList(){ | ||
| 72 | - $proofreadingModel = new Proofreading(); | ||
| 73 | - $list = $proofreadingModel->list(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>2],'created_at',['text','translate']); | ||
| 74 | - if(empty($list)){ | ||
| 75 | - $new_list = $this->getUrlImageRead($this->param['url']); | ||
| 76 | - foreach ($new_list as $k=>$v){ | ||
| 77 | - $data[] = [ | ||
| 78 | - 'text'=>$v, | ||
| 79 | - 'translate'=>$v, | ||
| 80 | - ]; | ||
| 81 | - } | ||
| 82 | - return $this->response('success',Code::SUCCESS,$data); | ||
| 83 | - } | ||
| 84 | - $new_list = $this->getUrlImageRead($this->param['url']); | ||
| 85 | - $data = [];//返回数据 | ||
| 86 | - $old_list = []; | ||
| 87 | - foreach ($list as $v){ | ||
| 88 | - $old_list[] = $v['text']; | ||
| 89 | - $data[] = [ | ||
| 90 | - 'text'=>$v['text'], | ||
| 91 | - 'translate'=>$v['translate'], | ||
| 92 | - ]; | ||
| 93 | - } | ||
| 94 | - $arr2 = array_values(array_diff($new_list, $old_list)); | ||
| 95 | - if(!empty($arr2)){ | ||
| 96 | - foreach ($arr2 as $v1){ | ||
| 97 | - $data[] = [ | ||
| 98 | - 'text'=>$v1, | ||
| 99 | - 'translate'=>$v1 | ||
| 100 | - ]; | ||
| 101 | - } | ||
| 102 | - } | ||
| 103 | - $this->response('success',Code::SUCCESS,$data); | ||
| 104 | - } | ||
| 105 | - | ||
| 106 | - /** | ||
| 107 | - * @name :(新增/更新多语言)save | ||
| 108 | - * @author :lyh | ||
| 109 | - * @method :post | ||
| 110 | - * @time :2023/6/12 10:52 | ||
| 111 | - */ | ||
| 112 | - public function save(){ | ||
| 113 | - //清除以前的翻译校队数据,重新添加 | ||
| 114 | - $param = [ | ||
| 115 | - 'type'=>1, | ||
| 116 | - 'project_id'=>$this->user['project_id'], | ||
| 117 | - 'url'=>$this->param['url'], | ||
| 118 | - 'language_id'=>$this->param['language_id'], | ||
| 119 | - 'alias'=>$this->param['alias'], | ||
| 120 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 121 | - 'updated_at'=>date('Y-m-d H:i:s') | ||
| 122 | - ]; | ||
| 123 | - $proofreadingModel = new Proofreading(); | ||
| 124 | - DB::beginTransaction(); | ||
| 125 | - try { | ||
| 126 | - $proofreadingModel->del(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>1]); | ||
| 127 | - //删除成功后,重新添加 | ||
| 128 | - $save_data = []; | ||
| 129 | - foreach ($this->param['data'] as $k => $v){ | ||
| 130 | - $param['text'] = $v['text']; | ||
| 131 | - $param['translate'] = $v['translate']; | ||
| 132 | - $save_data[] = $param; | ||
| 133 | - } | ||
| 134 | - $proofreadingModel->insert($save_data); | ||
| 135 | - DB::commit(); | ||
| 136 | - }catch (\Exception $e){ | ||
| 137 | - DB::rollBack(); | ||
| 138 | - $this->fail('系统错误请联系管理员'); | ||
| 139 | - } | ||
| 140 | - $this->response('success'); | ||
| 141 | - } | ||
| 142 | - | ||
| 143 | - /** | ||
| 144 | - * @name :(新增/更新多语言)save | ||
| 145 | - * @author :lyh | ||
| 146 | - * @method :post | ||
| 147 | - * @time :2023/6/12 10:52 | ||
| 148 | - */ | ||
| 149 | - public function saveImage(){ | ||
| 150 | - //清除以前的翻译校队数据,重新添加 | ||
| 151 | - $param = [ | ||
| 152 | - 'type'=>2, | ||
| 153 | - 'project_id'=>$this->user['project_id'], | ||
| 154 | - 'url'=>$this->param['url'], | ||
| 155 | - 'language_id'=>$this->param['language_id'], | ||
| 156 | - 'alias'=>$this->param['alias'], | ||
| 157 | - 'created_at'=>date('Y-m-d H:i:s'), | ||
| 158 | - 'updated_at'=>date('Y-m-d H:i:s') | ||
| 159 | - ]; | ||
| 160 | - $proofreadingModel = new Proofreading(); | ||
| 161 | - DB::beginTransaction(); | ||
| 162 | - try { | ||
| 163 | - $proofreadingModel->del(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>2]); | ||
| 164 | - //删除成功后,重新添加 | ||
| 165 | - $save_data = []; | ||
| 166 | - foreach ($this->param['data'] as $k => $v){ | ||
| 167 | - $param['text'] = $v['text']; | ||
| 168 | - $param['translate'] = $v['translate']; | ||
| 169 | - $save_data[] = $param; | ||
| 170 | - } | ||
| 171 | - $proofreadingModel->insert($save_data); | ||
| 172 | - DB::commit(); | ||
| 173 | - }catch (\Exception $e){ | ||
| 174 | - DB::rollBack(); | ||
| 175 | - $this->fail('系统错误请联系管理员'); | ||
| 176 | - } | ||
| 177 | - $this->response('success'); | ||
| 178 | - } | ||
| 179 | - | ||
| 180 | - /** | ||
| 181 | - * @remark :获取Url内容 | ||
| 182 | - * @name :getUrlRead | ||
| 183 | - * @author :lyh | ||
| 184 | - * @method :post | ||
| 185 | - * @time :2023/11/22 10:02 | ||
| 186 | - */ | ||
| 187 | - public function getUrlRead($url){ | ||
| 188 | - $contextOptions = [ | ||
| 189 | - 'ssl' => [ | ||
| 190 | - 'verify_peer' => false, | ||
| 191 | - 'verify_peer_name' => false, | ||
| 192 | - ], | ||
| 193 | - ]; | ||
| 194 | - $context = stream_context_create($contextOptions); | ||
| 195 | - $sourceCode = file_get_contents($url, false, $context); | ||
| 196 | - $pattern = '/<style\b[^>]*>(.*?)<\/style>/s'; // 定义匹配`<style>`标签及其内容的正则表达式 | ||
| 197 | - $strippedContent = preg_replace($pattern, '', $sourceCode); // 删除`<style>`标签及其内容 | ||
| 198 | - $pattern = '/<script\b[^>]*>(.*?)<\/script>/s'; // 定义匹配`<script>`标签及其内容的正则表达式 | ||
| 199 | - $strippedContent = preg_replace($pattern, '', $strippedContent); // 删除`<script>`标签及其内容 | ||
| 200 | - $pattern = '/<link\b[^>]*>/'; // 定义匹配 `<link>` 标签的正则表达式 | ||
| 201 | - $strippedContent = preg_replace($pattern, '', $strippedContent); // 删除 `<link>` 标签 | ||
| 202 | - $pattern = '/>([^<]+)</'; // 定义匹配中间内容不是标签的正则表达式 | ||
| 203 | - $matches = array(); | ||
| 204 | - preg_match_all($pattern, $strippedContent, $matches); | ||
| 205 | - $textContentArray = array_filter($matches[1], function($item) { | ||
| 206 | - return !empty(trim($item)); | ||
| 207 | - }); | ||
| 208 | - $data = []; | ||
| 209 | - foreach ($textContentArray as $v){ | ||
| 210 | - $content = trim($v); | ||
| 211 | - $trimmedString = preg_replace('/\s+/', ' ', $content); | ||
| 212 | - $data[] = $trimmedString; | ||
| 213 | - } | ||
| 214 | - $data = array_values($data); | ||
| 215 | -// $uniqueArray = array_unique($data); | ||
| 216 | -// $data = array_values($uniqueArray); | ||
| 217 | - return $data; | ||
| 218 | - } | ||
| 219 | - | ||
| 220 | - /** | ||
| 221 | - * @remark :获取Url内容 | ||
| 222 | - * @name :getUrlRead | ||
| 223 | - * @author :lyh | ||
| 224 | - * @method :post | ||
| 225 | - * @time :2023/11/22 10:02 | ||
| 226 | - */ | ||
| 227 | - public function getUrlImageRead($url){ | ||
| 228 | - $contextOptions = [ | ||
| 229 | - 'ssl' => [ | ||
| 230 | - 'verify_peer' => false, | ||
| 231 | - 'verify_peer_name' => false, | ||
| 232 | - ], | ||
| 233 | - ]; | ||
| 234 | - $pattern = '/<img.*?src="(.*?)".*?>/i'; | ||
| 235 | - $matches = array(); | ||
| 236 | - $context = stream_context_create($contextOptions); | ||
| 237 | - $sourceCode = file_get_contents($url, false, $context); | ||
| 238 | - preg_match_all($pattern, $sourceCode, $matches); | ||
| 239 | - $textContentArray = $matches[1]; | ||
| 240 | - $data = []; | ||
| 241 | - foreach ($textContentArray as $v){ | ||
| 242 | - if(!empty($v)){ | ||
| 243 | - $data[] = $v; | ||
| 244 | - } | ||
| 245 | - } | ||
| 246 | - $uniqueArray = array_unique($data); | ||
| 247 | - $data = array_values($uniqueArray); | ||
| 248 | - return $data; | ||
| 249 | - } | ||
| 250 | -} |
| @@ -85,8 +85,8 @@ class TranslateController extends BaseController | @@ -85,8 +85,8 @@ class TranslateController extends BaseController | ||
| 85 | 'url.required' => 'url不能为空', | 85 | 'url.required' => 'url不能为空', |
| 86 | 'alias.required' => 'url不能为空', | 86 | 'alias.required' => 'url不能为空', |
| 87 | ]); | 87 | ]); |
| 88 | - $logic->translateSave(); | ||
| 89 | - $this->response('success'); | 88 | + $rs = $logic->translateSave(); |
| 89 | + $this->response('success',Code::SUCCESS,$rs); | ||
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | /** | 92 | /** |
| @@ -41,7 +41,7 @@ class LoginLogic extends BaseLogic | @@ -41,7 +41,7 @@ class LoginLogic extends BaseLogic | ||
| 41 | */ | 41 | */ |
| 42 | public function login() | 42 | public function login() |
| 43 | { | 43 | { |
| 44 | - $manage = $this->model->select('id', 'name', 'password', 'token', 'status', 'gid', 'dept_id','role') | 44 | + $manage = $this->model->select('id', 'name', 'password', 'token', 'status', 'gid', 'dept_id','role','rules') |
| 45 | ->where('mobile', $this->param['mobile'])->first(); | 45 | ->where('mobile', $this->param['mobile'])->first(); |
| 46 | if (!$manage){ | 46 | if (!$manage){ |
| 47 | $this->fail('登录用户名不存在'); | 47 | $this->fail('登录用户名不存在'); |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Logic\Aside\Manage; | 3 | namespace App\Http\Logic\Aside\Manage; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | +use App\Helper\Arr; | ||
| 6 | use App\Helper\Common; | 7 | use App\Helper\Common; |
| 7 | use App\Http\Logic\Aside\BaseLogic; | 8 | use App\Http\Logic\Aside\BaseLogic; |
| 8 | use App\Models\Manage\Manage; | 9 | use App\Models\Manage\Manage; |
| @@ -59,6 +60,9 @@ class ManageLogic extends BaseLogic | @@ -59,6 +60,9 @@ class ManageLogic extends BaseLogic | ||
| 59 | if($managerInfo !== false){ | 60 | if($managerInfo !== false){ |
| 60 | $this->fail('当前手机号码已存在'); | 61 | $this->fail('当前手机号码已存在'); |
| 61 | } | 62 | } |
| 63 | + if (isset($this->param['rules']) && is_array($this->param['rules'])){ | ||
| 64 | + $this->param['rules'] = Arr::arrToSet($this->param['rules']); | ||
| 65 | + } | ||
| 62 | $this->param['password'] = Hash::make(isset($this->param['password']) ?? 'globalsov6'); | 66 | $this->param['password'] = Hash::make(isset($this->param['password']) ?? 'globalsov6'); |
| 63 | $this->model->add($this->param); | 67 | $this->model->add($this->param); |
| 64 | $this->success(); | 68 | $this->success(); |
| @@ -93,6 +97,9 @@ class ManageLogic extends BaseLogic | @@ -93,6 +97,9 @@ class ManageLogic extends BaseLogic | ||
| 93 | if(isset($this->param['password']) && !empty($this->param['password'])){ | 97 | if(isset($this->param['password']) && !empty($this->param['password'])){ |
| 94 | $this->param['password'] = Hash::make($this->param['password']); | 98 | $this->param['password'] = Hash::make($this->param['password']); |
| 95 | } | 99 | } |
| 100 | + if (isset($this->param['rules']) && is_array($this->param['rules'])){ | ||
| 101 | + $this->param['rules'] = Arr::arrToSet($this->param['rules']); | ||
| 102 | + } | ||
| 96 | $this->model->edit($this->param,['id'=>$this->param['id']]); | 103 | $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 97 | } | 104 | } |
| 98 | 105 | ||
| @@ -120,7 +127,10 @@ class ManageLogic extends BaseLogic | @@ -120,7 +127,10 @@ class ManageLogic extends BaseLogic | ||
| 120 | */ | 127 | */ |
| 121 | public function getManagerInfo(){ | 128 | public function getManagerInfo(){ |
| 122 | $info = $this->model->read(['id'=>$this->param['id']], | 129 | $info = $this->model->read(['id'=>$this->param['id']], |
| 123 | - ['id','name','email','mobile','status','gid','sort','dept_id','is_dept_manager','created_at','role','updated_at']); | 130 | + ['id','name','email','mobile','status','gid','sort','dept_id','is_dept_manager','created_at','role','rules','updated_at']); |
| 131 | + if(!empty($info['rules'])){ | ||
| 132 | + $info['rules'] = Arr::setToArr($info['rules']); | ||
| 133 | + } | ||
| 124 | if($info === false){ | 134 | if($info === false){ |
| 125 | $this->fail('error'); | 135 | $this->fail('error'); |
| 126 | } | 136 | } |
| @@ -93,6 +93,14 @@ class MenuLogic extends BaseLogic | @@ -93,6 +93,14 @@ class MenuLogic extends BaseLogic | ||
| 93 | */ | 93 | */ |
| 94 | public function getMenuByGroupId($gid){ | 94 | public function getMenuByGroupId($gid){ |
| 95 | $rights = Group::where(['id' => $gid, 'status' => Group::STATUS_NORMAL])->pluck('rights')->first(); | 95 | $rights = Group::where(['id' => $gid, 'status' => Group::STATUS_NORMAL])->pluck('rights')->first(); |
| 96 | + //获取个人权限 | ||
| 97 | + if(isset($this->manager['rules']) && !empty($this->manager['rules'])){ | ||
| 98 | + $rules = Arr::setToArr($this->manager['rules']); | ||
| 99 | + // 合并两个数组 | ||
| 100 | + $mergedArray = array_merge($rules, $rights); | ||
| 101 | + // 去除重复的元素 | ||
| 102 | + $rights = array_unique($mergedArray); | ||
| 103 | + } | ||
| 96 | $map = [ | 104 | $map = [ |
| 97 | 'type'=>0, | 105 | 'type'=>0, |
| 98 | 'status' => Menu::STATUS_NORMAL, | 106 | 'status' => Menu::STATUS_NORMAL, |
| @@ -98,9 +98,12 @@ class ProjectLogic extends BaseLogic | @@ -98,9 +98,12 @@ class ProjectLogic extends BaseLogic | ||
| 98 | //升级项目采集完成时间 | 98 | //升级项目采集完成时间 |
| 99 | $collect_time = ''; | 99 | $collect_time = ''; |
| 100 | if($info['is_upgrade'] == 1){ | 100 | if($info['is_upgrade'] == 1){ |
| 101 | - $collect_info = UpdateLog::where('project_id',$id)->where('api_type','blog')->first(); | ||
| 102 | - if($collect_info){ | ||
| 103 | - $collect_time = $collect_info->collect_status == 0 ? '采集中' : $collect_info->updated_at->format('Y-m-d H:i:s'); | 101 | + $collect_un_count = UpdateLog::where('project_id',$id)->where('collect_status',0)->count(); |
| 102 | + if($collect_un_count > 0){ | ||
| 103 | + $collect_time = '采集中'; | ||
| 104 | + }else{ | ||
| 105 | + $collect_info = UpdateLog::where('project_id',$id)->orderBy('updated_at','desc')->first(); | ||
| 106 | + $collect_time = $collect_info->updated_at->format('Y-m-d H:i:s'); | ||
| 104 | } | 107 | } |
| 105 | } | 108 | } |
| 106 | $info['collect_time'] = $collect_time; | 109 | $info['collect_time'] = $collect_time; |
| @@ -861,6 +864,7 @@ class ProjectLogic extends BaseLogic | @@ -861,6 +864,7 @@ class ProjectLogic extends BaseLogic | ||
| 861 | $param['designer_mid'] = $old_id; | 864 | $param['designer_mid'] = $old_id; |
| 862 | $deployBuildModel = new DeployBuild(); | 865 | $deployBuildModel = new DeployBuild(); |
| 863 | $deployBuildModel->edit(['designer_mid'=>$new_id],$param); | 866 | $deployBuildModel->edit(['designer_mid'=>$new_id],$param); |
| 867 | + break; | ||
| 864 | //技术助理 | 868 | //技术助理 |
| 865 | case 40: | 869 | case 40: |
| 866 | $param['tech_mid'] = $old_id; | 870 | $param['tech_mid'] = $old_id; |
| @@ -875,32 +879,35 @@ class ProjectLogic extends BaseLogic | @@ -875,32 +879,35 @@ class ProjectLogic extends BaseLogic | ||
| 875 | $deployOptimizeModel->edit(['manager_mid'=>$new_id],$param); | 879 | $deployOptimizeModel->edit(['manager_mid'=>$new_id],$param); |
| 876 | $param['tech_leader'] = $old_id; | 880 | $param['tech_leader'] = $old_id; |
| 877 | unset($param['manager_mid']); | 881 | unset($param['manager_mid']); |
| 878 | - $deployOptimizeModel->edit(['tech_leader'=>$new_id],['tech_leader'=>$old_id]); | 882 | + $deployOptimizeModel->edit(['tech_leader'=>$new_id],$param); |
| 879 | break; | 883 | break; |
| 880 | //优化师 | 884 | //优化师 |
| 881 | - case 44: | 885 | + case 46: |
| 882 | $param['optimist_mid'] = $old_id; | 886 | $param['optimist_mid'] = $old_id; |
| 883 | $deployOptimizeModel = new DeployOptimize(); | 887 | $deployOptimizeModel = new DeployOptimize(); |
| 884 | $deployOptimizeModel->edit(['optimist_mid'=>$new_id],$param); | 888 | $deployOptimizeModel->edit(['optimist_mid'=>$new_id],$param); |
| 885 | $param['assist_mid'] = $old_id; | 889 | $param['assist_mid'] = $old_id; |
| 886 | unset($param['optimist_mid']); | 890 | unset($param['optimist_mid']); |
| 887 | - $deployOptimizeModel->edit(['assist_mid'=>$new_id],['assist_mid'=>$old_id]); | 891 | + $deployOptimizeModel->edit(['assist_mid'=>$new_id],$param); |
| 888 | break; | 892 | break; |
| 889 | - case 46: | 893 | + case 49: |
| 890 | //优化师助理 | 894 | //优化师助理 |
| 891 | $param['assist_mid'] = $old_id; | 895 | $param['assist_mid'] = $old_id; |
| 892 | $deployOptimizeModel = new DeployOptimize(); | 896 | $deployOptimizeModel = new DeployOptimize(); |
| 893 | $deployOptimizeModel->edit(['assist_mid'=>$new_id],$param); | 897 | $deployOptimizeModel->edit(['assist_mid'=>$new_id],$param); |
| 898 | + break; | ||
| 894 | case 45: | 899 | case 45: |
| 895 | //售后技术 | 900 | //售后技术 |
| 896 | $param['tech_mid'] = $old_id; | 901 | $param['tech_mid'] = $old_id; |
| 897 | $deployOptimizeModel = new DeployOptimize(); | 902 | $deployOptimizeModel = new DeployOptimize(); |
| 898 | $deployOptimizeModel->edit(['tech_mid'=>$new_id],$param); | 903 | $deployOptimizeModel->edit(['tech_mid'=>$new_id],$param); |
| 904 | + break; | ||
| 899 | case 38: | 905 | case 38: |
| 900 | //品控 | 906 | //品控 |
| 901 | $param['design_mid'] = $old_id; | 907 | $param['design_mid'] = $old_id; |
| 902 | $deployOptimizeModel = new DeployOptimize(); | 908 | $deployOptimizeModel = new DeployOptimize(); |
| 903 | $deployOptimizeModel->edit(['design_mid'=>$new_id],$param); | 909 | $deployOptimizeModel->edit(['design_mid'=>$new_id],$param); |
| 910 | + break; | ||
| 904 | default: | 911 | default: |
| 905 | break; | 912 | break; |
| 906 | } | 913 | } |
| @@ -61,7 +61,12 @@ class TranslateLogic extends BaseLogic | @@ -61,7 +61,12 @@ class TranslateLogic extends BaseLogic | ||
| 61 | $data[] = [$k => $v]; | 61 | $data[] = [$k => $v]; |
| 62 | } | 62 | } |
| 63 | } | 63 | } |
| 64 | - $arr2 = array_values(array_diff($text_array, $old_key)); | 64 | + $arr2 = []; |
| 65 | + foreach ($text_array as $val) { | ||
| 66 | + if (FALSE == in_array($val, $old_key)){ | ||
| 67 | + $arr2[] = $val; | ||
| 68 | + } | ||
| 69 | + } | ||
| 65 | if(!empty($arr2)){ | 70 | if(!empty($arr2)){ |
| 66 | $i = 0; | 71 | $i = 0; |
| 67 | TranslateText: | 72 | TranslateText: |
| @@ -102,7 +107,7 @@ class TranslateLogic extends BaseLogic | @@ -102,7 +107,7 @@ class TranslateLogic extends BaseLogic | ||
| 102 | $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); | 107 | $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); |
| 103 | $data = []; | 108 | $data = []; |
| 104 | if(!empty($info) && !empty($info['data'])){ | 109 | if(!empty($info) && !empty($info['data'])){ |
| 105 | - $translateInfo = json_decode($info['data'],JSON_UNESCAPED_UNICODE); | 110 | + $translateInfo = json_decode($info['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); |
| 106 | foreach ($translateInfo as $k => $v){ | 111 | foreach ($translateInfo as $k => $v){ |
| 107 | $data[] = [$k=>$v]; | 112 | $data[] = [$k=>$v]; |
| 108 | } | 113 | } |
| @@ -191,6 +196,7 @@ class TranslateLogic extends BaseLogic | @@ -191,6 +196,7 @@ class TranslateLogic extends BaseLogic | ||
| 191 | } | 196 | } |
| 192 | $need_tran[] = $description ? $description->attr['content'] : ''; | 197 | $need_tran[] = $description ? $description->attr['content'] : ''; |
| 193 | $need_tran[] = $keywords ? $keywords->attr['content'] : ''; | 198 | $need_tran[] = $keywords ? $keywords->attr['content'] : ''; |
| 199 | + $need_tran = array_values(array_unique($need_tran)); | ||
| 194 | return $need_tran; | 200 | return $need_tran; |
| 195 | } | 201 | } |
| 196 | 202 | ||
| @@ -245,7 +251,7 @@ class TranslateLogic extends BaseLogic | @@ -245,7 +251,7 @@ class TranslateLogic extends BaseLogic | ||
| 245 | } | 251 | } |
| 246 | $this->param['data'] = $data; | 252 | $this->param['data'] = $data; |
| 247 | } | 253 | } |
| 248 | - try { | 254 | +// try { |
| 249 | $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]); | 255 | $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]); |
| 250 | if($info === false){ | 256 | if($info === false){ |
| 251 | $param = [ | 257 | $param = [ |
| @@ -256,21 +262,21 @@ class TranslateLogic extends BaseLogic | @@ -256,21 +262,21 @@ class TranslateLogic extends BaseLogic | ||
| 256 | 'alias'=>$this->param['alias'], | 262 | 'alias'=>$this->param['alias'], |
| 257 | ]; | 263 | ]; |
| 258 | $param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); | 264 | $param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); |
| 259 | - $this->model->add($param); | 265 | + $rs = $this->model->add($param); |
| 260 | }else{ | 266 | }else{ |
| 261 | if(!empty($data)){ | 267 | if(!empty($data)){ |
| 262 | $data = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); | 268 | $data = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); |
| 263 | - $this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'project_id'=>$this->user['project_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); | 269 | + $rs = $this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'project_id'=>$this->user['project_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); |
| 264 | } | 270 | } |
| 265 | } | 271 | } |
| 266 | //写日志 | 272 | //写日志 |
| 267 | $userLogModel = new UserLog(); | 273 | $userLogModel = new UserLog(); |
| 268 | $userLogModel->add(['model'=>'translate/save','remark'=>json_encode($this->param,true),'type'=>0,'operator_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]); | 274 | $userLogModel->add(['model'=>'translate/save','remark'=>json_encode($this->param,true),'type'=>0,'operator_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]); |
| 269 | - }catch (\Exception $e){ | ||
| 270 | - $this->fail('系统错误请联系管理员'); | ||
| 271 | - } | 275 | +// }catch (\Exception $e){ |
| 276 | +// $this->fail('系统错误请联系管理员'); | ||
| 277 | +// } | ||
| 272 | $this->handleRoute($this->param['url']); | 278 | $this->handleRoute($this->param['url']); |
| 273 | - return $this->success(); | 279 | + return $this->success($rs); |
| 274 | } | 280 | } |
| 275 | 281 | ||
| 276 | /** | 282 | /** |
| @@ -55,10 +55,8 @@ class RouteMap extends Base | @@ -55,10 +55,8 @@ class RouteMap extends Base | ||
| 55 | public static function generateRoute($title, $source, $source_id, $project_id){ | 55 | public static function generateRoute($title, $source, $source_id, $project_id){ |
| 56 | if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $title)){ | 56 | if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $title)){ |
| 57 | $title = Translate::tran($title, 'en'); | 57 | $title = Translate::tran($title, 'en'); |
| 58 | - }else{ | ||
| 59 | - if(!preg_match('/[a-zA-Z]/', $title)){ | ||
| 60 | - $title = Translate::tran($title, 'en'); | ||
| 61 | - } | 58 | + }elseif(preg_match('/^[\x{0400}-\x{04FF}]+$/u', $title)){ |
| 59 | + $title = Translate::tran($title, 'en'); | ||
| 62 | } | 60 | } |
| 63 | $i=1; | 61 | $i=1; |
| 64 | $sign = generateRoute($title); | 62 | $sign = generateRoute($title); |
| @@ -190,13 +190,6 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -190,13 +190,6 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 190 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingReceivingController::class, 'save'])->name('web_setting_receiving_save'); | 190 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingReceivingController::class, 'save'])->name('web_setting_receiving_save'); |
| 191 | }); | 191 | }); |
| 192 | 192 | ||
| 193 | - //翻译校队 | ||
| 194 | - Route::prefix('proofreading')->group(function () {//languageList | ||
| 195 | - Route::any('/', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'lists'])->name('web_proofreading_lists'); | ||
| 196 | - Route::any('/imageList', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'imageList'])->name('web_proofreading_imageList'); | ||
| 197 | - Route::any('/save', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'save'])->name('web_proofreading_save'); | ||
| 198 | - Route::any('/saveImage', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'saveImage'])->name('web_proofreading_saveImage'); | ||
| 199 | - }); | ||
| 200 | //新版翻译校队 | 193 | //新版翻译校队 |
| 201 | Route::prefix('translate_check')->group(function () {//languageList | 194 | Route::prefix('translate_check')->group(function () {//languageList |
| 202 | Route::any('/', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'lists'])->name('translate_check_lists'); | 195 | Route::any('/', [\App\Http\Controllers\Bside\Setting\TranslateController::class, 'lists'])->name('translate_check_lists'); |
-
请 注册 或 登录 后发表评论