作者 lyh

gx

1 -<?php  
2 -  
3 -namespace App\Helper;  
4 -  
5 -use App\Models\WebSetting\WebSettingCountry;  
6 -  
7 -/**  
8 - * @name:多语言国家设置  
9 - */  
10 -class Country  
11 -{  
12 - public $tls_list = [  
13 - 'en' => [  
14 - 'text' => '英语',  
15 - 'lang_text' => 'English',  
16 - 'con_flag' => 'con_flag/en.jfif',  
17 - 'shop_lang' => 'en-gb',  
18 - ],  
19 - 'zh' => [  
20 - 'text' => '中文',  
21 - 'lang_text' => '简体中文',  
22 - 'con_flag' => 'con_flag/zh.jfif',  
23 - 'shop_lang' => 'zh-cn',  
24 - ],  
25 - 'fr' => [  
26 - 'text' => '法语',  
27 - 'lang_text' => 'En français',  
28 - 'con_flag' => '',  
29 -  
30 - ],  
31 - 'de' => [  
32 - 'text' => '德语',  
33 - 'lang_text' => 'Das ist Deutsch.',  
34 - 'con_flag' => '',  
35 -  
36 - ],  
37 - 'ko' => [  
38 - 'text' => '韩语',  
39 - 'lang_text' => '',  
40 - 'con_flag' => '',  
41 -  
42 - ],  
43 - 'ja' => [  
44 - 'text' => '日语',  
45 - 'lang_text' => '',  
46 - 'con_flag' => '',  
47 -  
48 - ],  
49 - 'es' => [  
50 - 'text' => '西班牙语',  
51 - 'lang_text' => 'Español.',  
52 - 'con_flag' => '',  
53 -  
54 - ],  
55 - 'ar' => [  
56 - 'text' => '阿拉伯语',  
57 - 'lang_text' => '',  
58 - 'con_flag' => '',  
59 -  
60 - ],  
61 - 'pt' => [  
62 - 'text' => '葡萄牙语(葡萄牙、巴西)',  
63 - 'lang_text' => 'Língua portuguesa',  
64 - 'con_flag' => '',  
65 -  
66 - ],  
67 - 'ru' => [  
68 - 'text' => '俄语',  
69 - 'lang_text' => '',  
70 - 'con_flag' => '',  
71 -  
72 - ],  
73 - 'af' => [  
74 - 'text' => '南非荷兰语',  
75 - 'lang_text' => '',  
76 - 'con_flag' => '',  
77 -  
78 - ],  
79 - 'sq' => [  
80 - 'text' => '阿尔巴尼亚语',  
81 - 'lang_text' => '',  
82 - 'con_flag' => '',  
83 -  
84 - ],  
85 - 'am' => [  
86 - 'text' => '阿姆哈拉语',  
87 - 'lang_text' => '',  
88 - 'con_flag' => '',  
89 -  
90 - ],  
91 - 'hy' => [  
92 - 'text' => '亚美尼亚语',  
93 - 'lang_text' => '',  
94 - 'con_flag' => '',  
95 -  
96 - ],  
97 - 'az' => [  
98 - 'text' => '阿塞拜疆语',  
99 - 'lang_text' => '',  
100 - 'con_flag' => '',  
101 -  
102 - ],  
103 - 'eu' => [  
104 - 'text' => '巴斯克语',  
105 - 'lang_text' => '',  
106 - 'con_flag' => '',  
107 -  
108 - ],  
109 - 'be' => [  
110 - 'text' => '白俄罗斯语',  
111 - 'lang_text' => '',  
112 - 'con_flag' => '',  
113 -  
114 - ],  
115 - 'bn' => [  
116 - 'text' => '孟加拉语',  
117 - 'lang_text' => '',  
118 - 'con_flag' => '',  
119 -  
120 - ],  
121 - 'bs' => [  
122 - 'text' => '波斯尼亚语',  
123 - 'lang_text' => '',  
124 - 'con_flag' => '',  
125 -  
126 - ],  
127 - 'bg' => [  
128 - 'text' => '保加利亚语',  
129 - 'lang_text' => '',  
130 - 'con_flag' => '',  
131 -  
132 - ],  
133 - 'ca' => [  
134 - 'text' => '加泰罗尼亚语',  
135 - 'lang_text' => '',  
136 - 'con_flag' => '',  
137 -  
138 - ],  
139 - 'ceb' => [  
140 - 'text' => '宿务语',  
141 - 'lang_text' => '',  
142 - 'con_flag' => '',  
143 -  
144 - ],  
145 - 'cn' => [  
146 - 'text' => '中文(简体)',  
147 - 'lang_text' => '简体中文',  
148 - 'con_flag' => 'con_flag/zh.jfif',  
149 - 'shop_lang' => 'zh-cn',  
150 - ],  
151 - 'tw' => [  
152 - 'text' => '中文(繁体)',  
153 - 'lang_text' => '繁体中文',  
154 - 'con_flag' => 'con_flag/zh.jfif',  
155 -  
156 - ],  
157 - 'co' => [  
158 - 'text' => '科西嘉语',  
159 - 'lang_text' => '',  
160 - 'con_flag' => '',  
161 -  
162 - ],  
163 - 'hr' => [  
164 - 'text' => '克罗地亚语',  
165 - 'lang_text' => '',  
166 - 'con_flag' => '',  
167 -  
168 - ],  
169 - 'cs' => [  
170 - 'text' => '捷克语',  
171 - 'lang_text' => '',  
172 - 'con_flag' => '',  
173 -  
174 - ],  
175 - 'da' => [  
176 - 'text' => '丹麦语',  
177 - 'lang_text' => '',  
178 - 'con_flag' => '',  
179 -  
180 - ],  
181 - 'nl' => [  
182 - 'text' => '荷兰语',  
183 - 'lang_text' => '',  
184 - 'con_flag' => '',  
185 -  
186 - ],  
187 - 'eo' => [  
188 - 'text' => '世界语',  
189 - 'lang_text' => '',  
190 - 'con_flag' => '',  
191 -  
192 - ],  
193 - 'et' => [  
194 - 'text' => '爱沙尼亚语',  
195 - 'lang_text' => '',  
196 - 'con_flag' => '',  
197 -  
198 - ],  
199 - 'fi' => [  
200 - 'text' => '芬兰语',  
201 - 'lang_text' => '',  
202 - 'con_flag' => '',  
203 -  
204 - ],  
205 - 'fy' => [  
206 - 'text' => '弗里斯兰语',  
207 - 'lang_text' => '',  
208 - 'con_flag' => '',  
209 -  
210 - ],  
211 - 'gl' => [  
212 - 'text' => '加利西亚语',  
213 - 'lang_text' => '',  
214 - 'con_flag' => '',  
215 -  
216 - ],  
217 - 'ka' => [  
218 - 'text' => '格鲁吉亚语',  
219 - 'lang_text' => '',  
220 - 'con_flag' => '',  
221 -  
222 - ],  
223 - 'el' => [  
224 - 'text' => '希腊语',  
225 - 'lang_text' => '',  
226 - 'con_flag' => '',  
227 -  
228 - ],  
229 - 'gu' => [  
230 - 'text' => '古吉拉特语',  
231 - 'lang_text' => '',  
232 - 'con_flag' => '',  
233 -  
234 - ],  
235 - 'ht' => [  
236 - 'text' => '海地克里奥尔语',  
237 - 'lang_text' => '',  
238 - 'con_flag' => '',  
239 -  
240 - ],  
241 - 'ha' => [  
242 - 'text' => '豪萨语',  
243 - 'lang_text' => '',  
244 - 'con_flag' => '',  
245 -  
246 - ],  
247 - 'haw' => [  
248 - 'text' => '夏威夷语',  
249 - 'lang_text' => '',  
250 - 'con_flag' => '',  
251 -  
252 - ],  
253 - 'iw' => [  
254 - 'text' => '希伯来语',  
255 - 'lang_text' => '',  
256 - 'con_flag' => '',  
257 -  
258 - ],  
259 - 'hi' => [  
260 - 'text' => '印地语',  
261 - 'lang_text' => '',  
262 - 'con_flag' => '',  
263 -  
264 - ],  
265 - 'hmn' => [  
266 - 'text' => '苗语',  
267 - 'lang_text' => '',  
268 - 'con_flag' => '',  
269 -  
270 - ],  
271 - 'hu' => [  
272 - 'text' => '匈牙利语',  
273 - 'lang_text' => '',  
274 - 'con_flag' => '',  
275 -  
276 - ],  
277 - 'is' => [  
278 - 'text' => '冰岛语',  
279 - 'lang_text' => '',  
280 - 'con_flag' => '',  
281 -  
282 - ],  
283 - 'ig' => [  
284 - 'text' => '伊博语',  
285 - 'lang_text' => '',  
286 - 'con_flag' => '',  
287 -  
288 - ],  
289 - 'id' => [  
290 - 'text' => '印度尼西亚语',  
291 - 'lang_text' => 'Bahasa Indonesia',  
292 - 'con_flag' => 'con_flag/id.jfif',  
293 - 'shop_lang' => 'id',  
294 - ],  
295 - 'ga' => [  
296 - 'text' => '爱尔兰语',  
297 - 'lang_text' => '',  
298 - 'con_flag' => '',  
299 -  
300 - ],  
301 - 'it' => [  
302 - 'text' => '意大利语',  
303 - 'lang_text' => 'Lingua italiana',  
304 - 'con_flag' => '',  
305 -  
306 - ],  
307 - 'jw' => [  
308 - 'text' => '爪哇语',  
309 - 'lang_text' => '',  
310 - 'con_flag' => '',  
311 -  
312 - ],  
313 - 'kn' => [  
314 - 'text' => '卡纳达语',  
315 - 'lang_text' => '',  
316 - 'con_flag' => '',  
317 -  
318 - ],  
319 - 'kk' => [  
320 - 'text' => '哈萨克语',  
321 - 'lang_text' => '',  
322 - 'con_flag' => '',  
323 -  
324 - ],  
325 - 'km' => [  
326 - 'text' => '高棉语',  
327 - 'lang_text' => '',  
328 - 'con_flag' => '',  
329 -  
330 - ],  
331 - 'rw' => [  
332 - 'text' => '卢旺达语',  
333 - 'lang_text' => '',  
334 - 'con_flag' => '',  
335 -  
336 - ],  
337 - 'ku' => [  
338 - 'text' => '库尔德语',  
339 - 'lang_text' => '',  
340 - 'con_flag' => '',  
341 -  
342 - ],  
343 - 'ky' => [  
344 - 'text' => '吉尔吉斯语',  
345 - 'lang_text' => '',  
346 - 'con_flag' => '',  
347 -  
348 - ],  
349 - 'lo' => [  
350 - 'text' => '老挝文',  
351 - 'lang_text' => '',  
352 - 'con_flag' => '',  
353 -  
354 - ],  
355 - 'la' => [  
356 - 'text' => '拉丁文',  
357 - 'lang_text' => '',  
358 - 'con_flag' => '',  
359 -  
360 - ],  
361 - 'lv' => [  
362 - 'text' => '拉脱维亚语',  
363 - 'lang_text' => '',  
364 - 'con_flag' => '',  
365 -  
366 - ],  
367 - 'lt' => [  
368 - 'text' => '立陶宛语',  
369 - 'lang_text' => '',  
370 - 'con_flag' => '',  
371 -  
372 - ],  
373 - 'lb' => [  
374 - 'text' => '卢森堡语',  
375 - 'lang_text' => '',  
376 - 'con_flag' => '',  
377 -  
378 - ],  
379 - 'mk' => [  
380 - 'text' => '马其顿语',  
381 - 'lang_text' => '',  
382 - 'con_flag' => '',  
383 -  
384 - ],  
385 - 'mg' => [  
386 - 'text' => '马尔加什语',  
387 - 'lang_text' => '',  
388 - 'con_flag' => '',  
389 -  
390 - ],  
391 - 'ms' => [  
392 - 'text' => '马来语',  
393 - 'lang_text' => 'Bahasa Melayu',  
394 - 'con_flag' => 'con_flag/ms.jfif',  
395 - 'shop_lang' => 'ms-my',  
396 - ],  
397 - 'ml' => [  
398 - 'text' => '马拉雅拉姆文',  
399 - 'lang_text' => '',  
400 - 'con_flag' => '',  
401 -  
402 - ],  
403 - 'mt' => [  
404 - 'text' => '马耳他语',  
405 - 'lang_text' => '',  
406 - 'con_flag' => '',  
407 -  
408 - ],  
409 - 'mi' => [  
410 - 'text' => '毛利语',  
411 - 'lang_text' => '',  
412 - 'con_flag' => '',  
413 -  
414 - ],  
415 - 'mr' => [  
416 - 'text' => '马拉地语',  
417 - 'lang_text' => '',  
418 - 'con_flag' => '',  
419 -  
420 - ],  
421 - 'mn' => [  
422 - 'text' => '蒙古文',  
423 - 'lang_text' => '',  
424 - 'con_flag' => '',  
425 -  
426 - ],  
427 - 'my' => [  
428 - 'text' => '缅甸语',  
429 - 'lang_text' => '',  
430 - 'con_flag' => '',  
431 -  
432 - ],  
433 - 'ne' => [  
434 - 'text' => '尼泊尔语',  
435 - 'lang_text' => '',  
436 - 'con_flag' => '',  
437 -  
438 - ],  
439 - 'no' => [  
440 - 'text' => '挪威语',  
441 - 'lang_text' => '',  
442 - 'con_flag' => '',  
443 -  
444 - ],  
445 - 'ny' => [  
446 - 'text' => '尼杨扎语(齐切瓦语)',  
447 - 'lang_text' => '',  
448 - 'con_flag' => '',  
449 -  
450 - ],  
451 - 'or' => [  
452 - 'text' => '奥里亚语(奥里亚)',  
453 - 'lang_text' => '',  
454 - 'con_flag' => '',  
455 -  
456 - ],  
457 - 'ps' => [  
458 - 'text' => '普什图语',  
459 - 'lang_text' => '',  
460 - 'con_flag' => '',  
461 -  
462 - ],  
463 - 'fa' => [  
464 - 'text' => '波斯语',  
465 - 'lang_text' => '',  
466 - 'con_flag' => '',  
467 -  
468 - ],  
469 - 'pl' => [  
470 - 'text' => '波兰语',  
471 - 'lang_text' => '',  
472 - 'con_flag' => '',  
473 -  
474 - ],  
475 - 'pa' => [  
476 - 'text' => '旁遮普语',  
477 - 'lang_text' => '',  
478 - 'con_flag' => '',  
479 -  
480 - ],  
481 - 'ro' => [  
482 - 'text' => '罗马尼亚语',  
483 - 'lang_text' => '',  
484 - 'con_flag' => '',  
485 -  
486 - ],  
487 - 'sm' => [  
488 - 'text' => '萨摩亚语',  
489 - 'lang_text' => '',  
490 - 'con_flag' => '',  
491 -  
492 - ],  
493 - 'gd' => [  
494 - 'text' => '苏格兰盖尔语',  
495 - 'lang_text' => '',  
496 - 'con_flag' => '',  
497 -  
498 - ],  
499 - 'sr' => [  
500 - 'text' => '塞尔维亚语',  
501 - 'lang_text' => '',  
502 - 'con_flag' => '',  
503 -  
504 - ],  
505 - 'st' => [  
506 - 'text' => '塞索托语',  
507 - 'lang_text' => '',  
508 - 'con_flag' => '',  
509 -  
510 - ],  
511 - 'sn' => [  
512 - 'text' => '修纳语',  
513 - 'lang_text' => '',  
514 - 'con_flag' => '',  
515 -  
516 - ],  
517 - 'sd' => [  
518 - 'text' => '信德语',  
519 - 'lang_text' => '',  
520 - 'con_flag' => '',  
521 -  
522 - ],  
523 - 'si' => [  
524 - 'text' => '僧伽罗语',  
525 - 'lang_text' => '',  
526 - 'con_flag' => '',  
527 -  
528 - ],  
529 - 'sk' => [  
530 - 'text' => '斯洛伐克语',  
531 - 'lang_text' => '',  
532 - 'con_flag' => '',  
533 -  
534 - ],  
535 - 'sl' => [  
536 - 'text' => '斯洛文尼亚语',  
537 - 'lang_text' => '',  
538 - 'con_flag' => '',  
539 -  
540 - ],  
541 - 'so' => [  
542 - 'text' => '索马里语',  
543 - 'lang_text' => '',  
544 - 'con_flag' => '',  
545 -  
546 - ],  
547 - 'su' => [  
548 - 'text' => '巽他语',  
549 - 'lang_text' => '',  
550 - 'con_flag' => '',  
551 -  
552 - ],  
553 - 'sw' => [  
554 - 'text' => '斯瓦希里语',  
555 - 'lang_text' => '',  
556 - 'con_flag' => '',  
557 -  
558 - ],  
559 - 'sv' => [  
560 - 'text' => '瑞典语',  
561 - 'lang_text' => '',  
562 - 'con_flag' => '',  
563 -  
564 - ],  
565 - 'tl' => [  
566 - 'text' => '塔加路语(菲律宾语)',  
567 - 'lang_text' => 'Pilipino',  
568 - 'con_flag' => 'con_flag/tl.jfif',  
569 - 'shop_lang' => 'tl',  
570 - ],  
571 - 'tg' => [  
572 - 'text' => '塔吉克语',  
573 - 'lang_text' => '',  
574 - 'con_flag' => '',  
575 -  
576 - ],  
577 - 'ta' => [  
578 - 'text' => '泰米尔语',  
579 - 'lang_text' => '',  
580 - 'con_flag' => '',  
581 -  
582 - ],  
583 - 'tt' => [  
584 - 'text' => '鞑靼语',  
585 - 'lang_text' => '',  
586 - 'con_flag' => '',  
587 -  
588 - ],  
589 - 'te' => [  
590 - 'text' => '泰卢固语',  
591 - 'lang_text' => '',  
592 - 'con_flag' => '',  
593 -  
594 - ],  
595 - 'th' => [  
596 - 'text' => '泰文',  
597 - 'lang_text' => 'ไทย',  
598 - 'con_flag' => 'con_flag/th.jfif',  
599 - 'shop_lang' => 'th',  
600 - ],  
601 - 'tr' => [  
602 - 'text' => '土耳其语',  
603 - 'lang_text' => '',  
604 - 'con_flag' => '',  
605 -  
606 - ],  
607 - 'tk' => [  
608 - 'text' => '土库曼语',  
609 - 'lang_text' => '',  
610 - 'con_flag' => '',  
611 -  
612 - ],  
613 - 'uk' => [  
614 - 'text' => '乌克兰语',  
615 - 'lang_text' => '',  
616 - 'con_flag' => '',  
617 -  
618 - ],  
619 - 'ur' => [  
620 - 'text' => '乌尔都语',  
621 - 'lang_text' => '',  
622 - 'con_flag' => '',  
623 -  
624 - ],  
625 - 'ug' => [  
626 - 'text' => '维吾尔语',  
627 - 'lang_text' => '',  
628 - 'con_flag' => '',  
629 -  
630 - ],  
631 - 'uz' => [  
632 - 'text' => '乌兹别克语',  
633 - 'lang_text' => '',  
634 - 'con_flag' => '',  
635 -  
636 - ],  
637 - 'vi' => [  
638 - 'text' => '越南语',  
639 - 'lang_text' => '',  
640 - 'con_flag' => '',  
641 -  
642 - ],  
643 - 'cy' => [  
644 - 'text' => '威尔士语',  
645 - 'lang_text' => '',  
646 - 'con_flag' => '',  
647 -  
648 - ],  
649 - 'xh' => [  
650 - 'text' => '班图语',  
651 - 'lang_text' => '',  
652 - 'con_flag' => '',  
653 -  
654 - ],  
655 - 'yi' => [  
656 - 'text' => '意第绪语',  
657 - 'lang_text' => '',  
658 - 'con_flag' => '',  
659 -  
660 - ],  
661 - 'yo' => [  
662 - 'text' => '约鲁巴语',  
663 - 'lang_text' => '',  
664 - 'con_flag' => '',  
665 -  
666 - ],  
667 - 'zu' => [  
668 - 'text' => '祖鲁语',  
669 - 'lang_text' => '',  
670 - 'con_flag' => '',  
671 - ],  
672 - ];  
673 -  
674 - /**  
675 - * @name :(获取翻译国家)set_country  
676 - * @author :lyh  
677 - * @method :post  
678 - * @time :2023/5/4 17:57  
679 - */  
680 - public function set_country(){  
681 - $data = [];  
682 - foreach ($this->tls_list as $k=>$v){  
683 - $data[] = ['name'=>$v['text'],'alias'=>$k,'image'=>$k.'.png','con_flag'=>$v['con_flag'],'lang_text'=>$v['lang_text']];  
684 - }  
685 - $webCountry = new WebSettingCountry();  
686 - $webCountry->insert($data);  
687 - return true;  
688 - }  
689 -}  
@@ -11,16 +11,14 @@ namespace App\Http\Controllers\Bside\BCom; @@ -11,16 +11,14 @@ 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\Http\Logic\Bside\Setting\WebSettingLogic;  
15 use App\Models\Com\UpdateNotify; 14 use App\Models\Com\UpdateNotify;
16 use App\Models\Com\UpdateProgress; 15 use App\Models\Com\UpdateProgress;
17 use App\Models\Project\Country as CountryModel; 16 use App\Models\Project\Country as CountryModel;
18 use App\Models\Project\Project; 17 use App\Models\Project\Project;
19 use App\Models\RouteMap\RouteMap; 18 use App\Models\RouteMap\RouteMap;
20 use App\Models\WebSetting\WebLanguage; 19 use App\Models\WebSetting\WebLanguage;
21 -use App\Models\WebSetting\WebSettingCountry;  
22 use Illuminate\Http\Request; 20 use Illuminate\Http\Request;
23 -use Illuminate\Support\Facades\Redis; 21 +
24 22
25 /** 23 /**
26 * @remark :通知C端 24 * @remark :通知C端
@@ -5,9 +5,8 @@ namespace App\Http\Controllers\Bside\Setting; @@ -5,9 +5,8 @@ namespace App\Http\Controllers\Bside\Setting;
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
6 use App\Helper\Translate; 6 use App\Helper\Translate;
7 use App\Http\Controllers\Bside\BaseController; 7 use App\Http\Controllers\Bside\BaseController;
8 -use App\Http\Logic\Bside\Setting\ProofreadingLogic;  
9 use App\Models\WebSetting\Proofreading; 8 use App\Models\WebSetting\Proofreading;
10 -use App\Models\WebSetting\WebSettingCountry; 9 +use App\Models\WebSetting\WebLanguage;
11 use Illuminate\Support\Facades\DB; 10 use Illuminate\Support\Facades\DB;
12 11
13 class ProofreadingController extends BaseController 12 class ProofreadingController extends BaseController
@@ -22,8 +21,8 @@ class ProofreadingController extends BaseController @@ -22,8 +21,8 @@ class ProofreadingController extends BaseController
22 */ 21 */
23 public function lists(){ 22 public function lists(){
24 //获取语种信息 23 //获取语种信息
25 - $webSettingCountryModel = new WebSettingCountry();  
26 - $countryInfo = $webSettingCountryModel->read(['id'=>$this->param['language_id']]); 24 + $languageModel = new WebLanguage();
  25 + $languageInfo = $languageModel->read(['id'=>$this->param['language_id']]);
27 //获取当前链接和语种的校队列表 26 //获取当前链接和语种的校队列表
28 $proofreadingModel = new Proofreading(); 27 $proofreadingModel = new Proofreading();
29 $list = $proofreadingModel->list(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>1],'created_at',['text','translate']); 28 $list = $proofreadingModel->list(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>1],'created_at',['text','translate']);
@@ -31,7 +30,7 @@ class ProofreadingController extends BaseController @@ -31,7 +30,7 @@ class ProofreadingController extends BaseController
31 $new_list = $this->getUrlRead($this->param['url']); 30 $new_list = $this->getUrlRead($this->param['url']);
32 if(empty($list)){ 31 if(empty($list)){
33 $data = []; 32 $data = [];
34 - $translate_list = Translate::tran($new_list, $countryInfo['alias']); 33 + $translate_list = Translate::tran($new_list, $languageInfo['short']);
35 foreach ($new_list as $k=>$v){ 34 foreach ($new_list as $k=>$v){
36 $data[] = [ 35 $data[] = [
37 'text'=>trim($v), 36 'text'=>trim($v),
@@ -51,7 +50,7 @@ class ProofreadingController extends BaseController @@ -51,7 +50,7 @@ class ProofreadingController extends BaseController
51 } 50 }
52 $arr2 = array_values(array_diff($new_list, $old_list)); 51 $arr2 = array_values(array_diff($new_list, $old_list));
53 if(!empty($arr2)){ 52 if(!empty($arr2)){
54 - $translate_list = Translate::tran($arr2, $countryInfo['alias']); 53 + $translate_list = Translate::tran($arr2, $languageInfo['alias']);
55 foreach ($arr2 as $k1=>$v1){ 54 foreach ($arr2 as $k1=>$v1){
56 $data[] = [ 55 $data[] = [
57 'text'=>$v1, 56 'text'=>$v1,
@@ -179,17 +178,6 @@ class ProofreadingController extends BaseController @@ -179,17 +178,6 @@ class ProofreadingController extends BaseController
179 } 178 }
180 179
181 /** 180 /**
182 - * @name :(当前项目选中的语言列表)languageList  
183 - * @author :lyh  
184 - * @method :post  
185 - * @time :2023/6/12 15:52  
186 - */  
187 - public function languageList(ProofreadingLogic $proofreadingLogic){  
188 - $list = $proofreadingLogic->countryLanguageList($this->map,$this->order);  
189 - $this->response('success',Code::SUCCESS,$list);  
190 - }  
191 -  
192 - /**  
193 * @remark :获取Url内容 181 * @remark :获取Url内容
194 * @name :getUrlRead 182 * @name :getUrlRead
195 * @author :lyh 183 * @author :lyh
1 -<?php  
2 -  
3 -namespace App\Http\Logic\Bside\Setting;  
4 -  
5 -use App\Http\Logic\Bside\BaseLogic;  
6 -use App\Models\Project\Country;  
7 -use App\Models\WebSetting\Proofreading;  
8 -use App\Models\WebSetting\WebSettingCountry;  
9 -use Illuminate\Support\Facades\DB;  
10 -  
11 -class ProofreadingLogic extends BaseLogic  
12 -{  
13 -  
14 - public function __construct()  
15 - {  
16 - parent::__construct();  
17 - $this->model = new Proofreading();  
18 - $this->param = $this->requestAll;  
19 - }  
20 -  
21 - /**  
22 - * @name :(保存翻译校队)proofreadingSave  
23 - * @author :lyh  
24 - * @method :post  
25 - * @time :2023/6/12 11:03  
26 - */  
27 - public function proofreadingSave(){  
28 - DB::beginTransaction();  
29 - try {  
30 - //删除以前的数据  
31 - $this->model->del(['project_id'=>$this->user['project_id'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]);  
32 - foreach ($this->param['data'] as $k => $v){  
33 - $v['created_at'] = date('Y-m-d H:i:s');  
34 - $v['updated_at'] = date('Y-m-d H:i:s');  
35 - $v['project_id'] = $this->user['project_id'];  
36 - $v['language_id'] = $this->param['language_id'];  
37 - $v['type'] = $this->param['type'];  
38 - $v['alias'] = $this->param['alias'];  
39 - $this->param['data'][$k] = $v;  
40 - }  
41 - //新增  
42 - $this->model->insert($this->param['data']);  
43 - DB::commit();  
44 - }catch (\Exception $e){  
45 - DB::rollBack();  
46 - $this->fail('error');  
47 - }  
48 - return $this->success();  
49 - }  
50 -  
51 - /**  
52 - * @name :(项目已选中多语言国家列表)countryLanguageList  
53 - * @author :lyh  
54 - * @method :post  
55 - * @time :2023/6/12 15:54  
56 - */  
57 - public function countryLanguageList($map,$order = 'created_at'){  
58 - $map['project_id'] = $this->user['project_id'];  
59 - $projectCountryModel = new Country();  
60 - $countryInfo = $projectCountryModel->read($map);  
61 - $list = [];  
62 - if(!empty($countryInfo['country_lists'])){  
63 - $countryArr = explode(",",$countryInfo['country_lists']);  
64 - $webCountryModel = new WebSettingCountry();  
65 - $list = $webCountryModel->list(['id'=>['in',$countryArr]]);  
66 - }  
67 - return $this->success($list);  
68 - }  
69 -}  
1 -<?php  
2 -  
3 -namespace App\Http\Logic\Bside\Setting;  
4 -  
5 -use App\Http\Logic\Bside\BaseLogic;  
6 -use App\Models\Project\Country;  
7 -use App\Models\Project\Country as CountryModel;  
8 -use App\Models\WebSetting\WebSettingCountry;  
9 -  
10 -class WebSettingCountryLogic extends BaseLogic  
11 -{  
12 - public function __construct()  
13 - {  
14 - parent::__construct();  
15 -  
16 - $this->model = new WebSettingCountry();  
17 - $this->param = $this->requestAll;  
18 - }  
19 -  
20 - /**  
21 - * @name :(获取多语言国家)user_country_list  
22 - * @author :lyh  
23 - * @method :post  
24 - * @time :2023/4/28 16:18  
25 - */  
26 - public function country_list(){  
27 - $lists = $this->model->list($this->param,'id',['id','name','alias','lang_text']);  
28 - return $this->success($lists);  
29 - }  
30 -  
31 -}  
1 -<?php  
2 -  
3 -namespace App\Models\WebSetting;  
4 -  
5 -use App\Models\Base;  
6 -  
7 -class WebSettingCountry extends Base  
8 -{  
9 - protected $table = 'gl_web_setting_country';  
10 -  
11 -}  
@@ -170,7 +170,6 @@ Route::middleware(['bloginauth'])->group(function () { @@ -170,7 +170,6 @@ Route::middleware(['bloginauth'])->group(function () {
170 Route::any('/imageList', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'imageList'])->name('web_proofreading_imageList'); 170 Route::any('/imageList', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'imageList'])->name('web_proofreading_imageList');
171 Route::any('/save', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'save'])->name('web_proofreading_save'); 171 Route::any('/save', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'save'])->name('web_proofreading_save');
172 Route::any('/saveImage', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'saveImage'])->name('web_proofreading_saveImage'); 172 Route::any('/saveImage', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'saveImage'])->name('web_proofreading_saveImage');
173 - Route::any('/languageList', [\App\Http\Controllers\Bside\Setting\ProofreadingController::class, 'languageList'])->name('web_proofreading_languageList');  
174 }); 173 });
175 174
176 //seo设置 175 //seo设置