作者 lyh

gx

@@ -13,7 +13,9 @@ use App\Helper\Arr; @@ -13,7 +13,9 @@ use App\Helper\Arr;
13 use App\Helper\Translate; 13 use App\Helper\Translate;
14 use App\Models\Ai\AiBlog; 14 use App\Models\Ai\AiBlog;
15 use App\Models\Blog\Blog; 15 use App\Models\Blog\Blog;
  16 +use App\Models\Com\WordCountry;
16 use App\Models\CustomModule\CustomModuleContent; 17 use App\Models\CustomModule\CustomModuleContent;
  18 +use App\Models\GoogleSearch\GoogleCodeCountry;
17 use App\Models\Product\CategoryRelated; 19 use App\Models\Product\CategoryRelated;
18 use App\Models\Product\Keyword; 20 use App\Models\Product\Keyword;
19 use App\Models\Product\Product; 21 use App\Models\Product\Product;
@@ -64,7 +66,7 @@ class UpdateRoute extends Command @@ -64,7 +66,7 @@ class UpdateRoute extends Command
64 */ 66 */
65 public function handle() 67 public function handle()
66 { 68 {
67 - $this->updateProjectOp(); 69 + $this->insertData();
68 } 70 }
69 /** 71 /**
70 * @remark : 72 * @remark :
@@ -543,9 +545,264 @@ class UpdateRoute extends Command @@ -543,9 +545,264 @@ class UpdateRoute extends Command
543 * @method :post 545 * @method :post
544 * @time :2025/3/14 14:39 546 * @time :2025/3/14 14:39
545 */ 547 */
546 - public function updateSeo(){  
547 - $contentModel = new CustomModuleContent();  
548 - $contentModel->edit(['seo_title'=>''],['created_at'=>['<=','2024-11-25 00:00:00']]); 548 + public function insertData(){
  549 + $countries = [
  550 + 'AFG' => 'Afghanistan',
  551 + 'ALB' => 'Albania',
  552 + 'DZA' => 'Algeria',
  553 + 'AND' => 'Andorra',
  554 + 'AGO' => 'Angola',
  555 + 'ATG' => 'Antigua and Barbuda',
  556 + 'ARG' => 'Argentina',
  557 + 'ARM' => 'Armenia',
  558 + 'AUS' => 'Australia',
  559 + 'AUT' => 'Austria',
  560 + 'AZE' => 'Azerbaijan',
  561 + 'BHS' => 'Bahamas',
  562 + 'BHR' => 'Bahrain',
  563 + 'BGD' => 'Bangladesh',
  564 + 'BRB' => 'Barbados',
  565 + 'BLR' => 'Belarus',
  566 + 'BEL' => 'Belgium',
  567 + 'BLZ' => 'Belize',
  568 + 'BEN' => 'Benin',
  569 + 'BTN' => 'Bhutan',
  570 + 'BOL' => 'Bolivia',
  571 + 'BES' => 'Bonaire, Sint Eustatius and Saba',
  572 + 'BIH' => 'Bosnia and Herzegovina',
  573 + 'BWA' => 'Botswana',
  574 + 'BVT' => 'Bouvet Island',
  575 + 'BRA' => 'Brazil',
  576 + 'IOT' => 'British Indian Ocean Territory',
  577 + 'BRN' => 'Brunei Darussalam',
  578 + 'BGR' => 'Bulgaria',
  579 + 'BFA' => 'Burkina Faso',
  580 + 'BDI' => 'Burundi',
  581 + 'CPV' => 'Cabo Verde',
  582 + 'KHM' => 'Cambodia',
  583 + 'CMR' => 'Cameroon',
  584 + 'CAN' => 'Canada',
  585 + 'CYM' => 'Cayman Islands',
  586 + 'CAF' => 'Central African Republic',
  587 + 'TCD' => 'Chad',
  588 + 'CHL' => 'Chile',
  589 + 'CHN' => 'China',
  590 + 'CXR' => 'Christmas Island',
  591 + 'CCK' => 'Cocos (Keeling) Islands',
  592 + 'COL' => 'Colombia',
  593 + 'COM' => 'Comoros',
  594 + 'COD' => 'Congo (Democratic Republic of the)',
  595 + 'COG' => 'Congo',
  596 + 'COK' => 'Cook Islands',
  597 + 'CRI' => 'Costa Rica',
  598 + 'CIV' => 'Côte d\'Ivoire',
  599 + 'HRV' => 'Croatia',
  600 + 'CUB' => 'Cuba',
  601 + 'CUW' => 'Curaçao',
  602 + 'CYP' => 'Cyprus',
  603 + 'CZE' => 'Czech Republic',
  604 + 'DNK' => 'Denmark',
  605 + 'DJI' => 'Djibouti',
  606 + 'DMA' => 'Dominica',
  607 + 'DOM' => 'Dominican Republic',
  608 + 'ECU' => 'Ecuador',
  609 + 'EGY' => 'Egypt',
  610 + 'SLV' => 'El Salvador',
  611 + 'GNQ' => 'Equatorial Guinea',
  612 + 'ERI' => 'Eritrea',
  613 + 'EST' => 'Estonia',
  614 + 'SWZ' => 'Eswatini',
  615 + 'ETH' => 'Ethiopia',
  616 + 'FLK' => 'Falkland Islands (Malvinas)',
  617 + 'FRO' => 'Faroe Islands',
  618 + 'FJI' => 'Fiji',
  619 + 'FIN' => 'Finland',
  620 + 'FRA' => 'France',
  621 + 'GUF' => 'French Guiana',
  622 + 'PYF' => 'French Polynesia',
  623 + 'ATF' => 'French Southern Territories',
  624 + 'GAB' => 'Gabon',
  625 + 'GMB' => 'Gambia',
  626 + 'GEO' => 'Georgia',
  627 + 'DEU' => 'Germany',
  628 + 'GHA' => 'Ghana',
  629 + 'GIB' => 'Gibraltar',
  630 + 'GRC' => 'Greece',
  631 + 'GRL' => 'Greenland',
  632 + 'GRD' => 'Grenada',
  633 + 'GLP' => 'Guadeloupe',
  634 + 'GUM' => 'Guam',
  635 + 'GTM' => 'Guatemala',
  636 + 'GGY' => 'Guernsey',
  637 + 'GIN' => 'Guinea',
  638 + 'GNB' => 'Guinea-Bissau',
  639 + 'GUY' => 'Guyana',
  640 + 'HTI' => 'Haiti',
  641 + 'HMD' => 'Heard Island and McDonald Islands',
  642 + 'VAT' => 'Holy See',
  643 + 'HND' => 'Honduras',
  644 + 'HKG' => 'Hong Kong',
  645 + 'HUN' => 'Hungary',
  646 + 'ISL' => 'Iceland',
  647 + 'IND' => 'India',
  648 + 'IDN' => 'Indonesia',
  649 + 'IRN' => 'Iran (Islamic Republic of)',
  650 + 'IRQ' => 'Iraq',
  651 + 'IRL' => 'Ireland',
  652 + 'IMN' => 'Isle of Man',
  653 + 'ISR' => 'Israel',
  654 + 'ITA' => 'Italy',
  655 + 'JAM' => 'Jamaica',
  656 + 'JPN' => 'Japan',
  657 + 'JEY' => 'Jersey',
  658 + 'JOR' => 'Jordan',
  659 + 'KAZ' => 'Kazakhstan',
  660 + 'KEN' => 'Kenya',
  661 + 'KIR' => 'Kiribati',
  662 + 'KOR' => 'Korea (Republic of)',
  663 + 'KWT' => 'Kuwait',
  664 + 'KGZ' => 'Kyrgyzstan',
  665 + 'LAO' => 'Lao People\'s Democratic Republic',
  666 + 'LVA' => 'Latvia',
  667 + 'LBN' => 'Lebanon',
  668 + 'LSO' => 'Lesotho',
  669 + 'LBR' => 'Liberia',
  670 + 'LBY' => 'Libya',
  671 + 'LIE' => 'Liechtenstein',
  672 + 'LTU' => 'Lithuania',
  673 + 'LUX' => 'Luxembourg',
  674 + 'MAC' => 'Macao',
  675 + 'MDG' => 'Madagascar',
  676 + 'MWI' => 'Malawi',
  677 + 'MYS' => 'Malaysia',
  678 + 'MDV' => 'Maldives',
  679 + 'MLI' => 'Mali',
  680 + 'MLT' => 'Malta',
  681 + 'MHL' => 'Marshall Islands',
  682 + 'MTQ' => 'Martinique',
  683 + 'MRT' => 'Mauritania',
  684 + 'MUS' => 'Mauritius',
  685 + 'MYT' => 'Mayotte',
  686 + 'MEX' => 'Mexico',
  687 + 'FSM' => 'Micronesia (Federated States of)',
  688 + 'MDA' => 'Moldova (Republic of)',
  689 + 'MCO' => 'Monaco',
  690 + 'MNG' => 'Mongolia',
  691 + 'MNE' => 'Montenegro',
  692 + 'MSR' => 'Montserrat',
  693 + 'MAR' => 'Morocco',
  694 + 'MOZ' => 'Mozambique',
  695 + 'MMR' => 'Myanmar',
  696 + 'NAM' => 'Namibia',
  697 + 'NRU' => 'Nauru',
  698 + 'NPL' => 'Nepal',
  699 + 'NLD' => 'Netherlands',
  700 + 'NCL' => 'New Caledonia',
  701 + 'NZL' => 'New Zealand',
  702 + 'NIC' => 'Nicaragua',
  703 + 'NER' => 'Niger',
  704 + 'NGA' => 'Nigeria',
  705 + 'NIU' => 'Niue',
  706 + 'NFK' => 'Norfolk Island',
  707 + 'MNP' => 'Northern Mariana Islands',
  708 + 'NOR' => 'Norway',
  709 + 'OMN' => 'Oman',
  710 + 'PAK' => 'Pakistan',
  711 + 'PLW' => 'Palau',
  712 + 'PSE' => 'Palestine, State of',
  713 + 'PAN' => 'Panama',
  714 + 'PNG' => 'Papua New Guinea',
  715 + 'PRY' => 'Paraguay',
  716 + 'PER' => 'Peru',
  717 + 'PHL' => 'Philippines',
  718 + 'PCN' => 'Pitcairn',
  719 + 'POL' => 'Poland',
  720 + 'PRT' => 'Portugal',
  721 + 'PRI' => 'Puerto Rico',
  722 + 'QAT' => 'Qatar',
  723 + 'REU' => 'Réunion',
  724 + 'ROU' => 'Romania',
  725 + 'RUS' => 'Russian Federation',
  726 + 'RWA' => 'Rwanda',
  727 + 'BLM' => 'Saint Barthélemy',
  728 + 'SHN' => 'Saint Helena, Ascension and Tristan da Cunha',
  729 + 'KNA' => 'Saint Kitts and Nevis',
  730 + 'LCA' => 'Saint Lucia',
  731 + 'MAF' => 'Saint Martin (French part)',
  732 + 'SPM' => 'Saint Pierre and Miquelon',
  733 + 'VCT' => 'Saint Vincent and the Grenadines',
  734 + 'WSM' => 'Samoa',
  735 + 'SMR' => 'San Marino',
  736 + 'STP' => 'Sao Tome and Principe',
  737 + 'SAU' => 'Saudi Arabia',
  738 + 'SEN' => 'Senegal',
  739 + 'SRB' => 'Serbia',
  740 + 'SYC' => 'Seychelles',
  741 + 'SLE' => 'Sierra Leone',
  742 + 'SGP' => 'Singapore',
  743 + 'SXM' => 'Sint Maarten (Dutch part)',
  744 + 'SVK' => 'Slovakia',
  745 + 'SVN' => 'Slovenia',
  746 + 'SLB' => 'Solomon Islands',
  747 + 'SOM' => 'Somalia',
  748 + 'ZAF' => 'South Africa',
  749 + 'SGS' => 'South Georgia and the South Sandwich Islands',
  750 + 'SSD' => 'South Sudan',
  751 + 'ESP' => 'Spain',
  752 + 'LKA' => 'Sri Lanka',
  753 + 'SDN' => 'Sudan',
  754 + 'SUR' => 'Suriname',
  755 + 'SJM' => 'Svalbard and Jan Mayen',
  756 + 'SWE' => 'Sweden',
  757 + 'CHE' => 'Switzerland',
  758 + 'SYR' => 'Syrian Arab Republic',
  759 + 'TWN' => 'Taiwan, Province of China',
  760 + 'TJK' => 'Tajikistan',
  761 + 'TZA' => 'Tanzania, United Republic of',
  762 + 'THA' => 'Thailand',
  763 + 'TLS' => 'Timor-Leste',
  764 + 'TGO' => 'Togo',
  765 + 'TKL' => 'Tokelau',
  766 + 'TON' => 'Tonga',
  767 + 'TTO' => 'Trinidad and Tobago',
  768 + 'TUN' => 'Tunisia',
  769 + 'TUR' => 'Turkey',
  770 + 'TKM' => 'Turkmenistan',
  771 + 'TCA' => 'Turks and Caicos Islands',
  772 + 'TUV' => 'Tuvalu',
  773 + 'UGA' => 'Uganda',
  774 + 'UKR' => 'Ukraine',
  775 + 'ARE' => 'United Arab Emirates',
  776 + 'GBR' => 'United Kingdom',
  777 + 'USA' => 'United States',
  778 + 'URY' => 'Uruguay',
  779 + 'UZB' => 'Uzbekistan',
  780 + 'VUT' => 'Vanuatu',
  781 + 'VEN' => 'Venezuela (Bolivarian Republic of)',
  782 + 'VNM' => 'Viet Nam',
  783 + 'WLF' => 'Wallis and Futuna',
  784 + 'ESH' => 'Western Sahara',
  785 + 'YEM' => 'Yemen',
  786 + 'ZMB' => 'Zambia',
  787 + 'ZWE' => 'Zimbabwe',
  788 + ];
  789 + $codeCountryModel = new GoogleCodeCountry();
  790 + $data = [];
  791 + foreach ($countries as $key =>$val){
  792 + $wordModel = new WordCountry();
  793 + $info = $wordModel->read(['iso3'=>$key]);
  794 + if($info === false){
  795 + $zh = Translate::tran($val,'zh');
  796 + }else{
  797 + $zh = $info['chinese_name'];
  798 + }
  799 + $data[] = [
  800 + 'code'=>$key,
  801 + 'en_country'=>$val,
  802 + 'zh_country'=>$zh,
  803 + ];
  804 + }
  805 + $codeCountryModel->insertAll($data);
549 return true; 806 return true;
550 } 807 }
551 } 808 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :GoogleCodeCountry.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/4/3 10:13
  8 + */
  9 +
  10 +namespace App\Models\GoogleSearch;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +class GoogleCodeCountry extends Base
  15 +{
  16 + protected $table = 'gl_google_code_country';
  17 +}