作者 lyh

gx

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