Merge remote-tracking branch 'origin/master' into akun
正在显示
16 个修改的文件
包含
350 行增加
和
38 行删除
| @@ -5,6 +5,7 @@ namespace App\Console\Commands\DayCount; | @@ -5,6 +5,7 @@ namespace App\Console\Commands\DayCount; | ||
| 5 | use App\Helper\Common; | 5 | use App\Helper\Common; |
| 6 | use App\Helper\FormGlobalsoApi; | 6 | use App\Helper\FormGlobalsoApi; |
| 7 | use App\Models\Domain\DomainInfo; | 7 | use App\Models\Domain\DomainInfo; |
| 8 | +use App\Models\Inquiry\InquiryOther; | ||
| 8 | use App\Models\Project\DeployBuild; | 9 | use App\Models\Project\DeployBuild; |
| 9 | use App\Models\Project\DeployOptimize; | 10 | use App\Models\Project\DeployOptimize; |
| 10 | use App\Models\Project\Project; | 11 | use App\Models\Project\Project; |
| @@ -80,7 +81,7 @@ class Count extends Command | @@ -80,7 +81,7 @@ class Count extends Command | ||
| 80 | $arr['created_at'] = date('Y-m-d H:i:s'); | 81 | $arr['created_at'] = date('Y-m-d H:i:s'); |
| 81 | $arr['updated_at'] = date('Y-m-d H:i:s'); | 82 | $arr['updated_at'] = date('Y-m-d H:i:s'); |
| 82 | //询盘统计 | 83 | //询盘统计 |
| 83 | - $arr = $this->inquiry($arr,$v['test_domain']); | 84 | + $arr = $this->inquiry($arr,$v['test_domain'], $v['id']); |
| 84 | echo date('Y-m-d H:i:s') . json_encode($arr) . '->' . PHP_EOL; | 85 | echo date('Y-m-d H:i:s') . json_encode($arr) . '->' . PHP_EOL; |
| 85 | $data[] = $arr; | 86 | $data[] = $arr; |
| 86 | } | 87 | } |
| @@ -124,11 +125,11 @@ class Count extends Command | @@ -124,11 +125,11 @@ class Count extends Command | ||
| 124 | * @method :post | 125 | * @method :post |
| 125 | * @time :2023/6/14 15:44 | 126 | * @time :2023/6/14 15:44 |
| 126 | */ | 127 | */ |
| 127 | - public function inquiry($arr,$domain){ | 128 | + public function inquiry($arr,$domain,$project_id){ |
| 128 | $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); | 129 | $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); |
| 129 | if($inquiry_list['status'] == self::STATUS_ERROR){ | 130 | if($inquiry_list['status'] == self::STATUS_ERROR){ |
| 130 | $arr['inquiry_num'] = 0; | 131 | $arr['inquiry_num'] = 0; |
| 131 | - $arr['country'] = json_encode([]); | 132 | + $countryArr = []; |
| 132 | }else{ | 133 | }else{ |
| 133 | $arr['inquiry_num'] = $inquiry_list['data']['total']; | 134 | $arr['inquiry_num'] = $inquiry_list['data']['total']; |
| 134 | //询盘国家统计 | 135 | //询盘国家统计 |
| @@ -138,13 +139,27 @@ class Count extends Command | @@ -138,13 +139,27 @@ class Count extends Command | ||
| 138 | if(isset($countryArr[$v1['country']])){ | 139 | if(isset($countryArr[$v1['country']])){ |
| 139 | $countryArr[$v1['country']]++; | 140 | $countryArr[$v1['country']]++; |
| 140 | }else{ | 141 | }else{ |
| 141 | - $countryArr[$v1['country']] = 0; | 142 | + $countryArr[$v1['country']] = 1; |
| 143 | + } | ||
| 142 | } | 144 | } |
| 143 | } | 145 | } |
| 146 | + | ||
| 147 | + //加上其他询盘 | ||
| 148 | + ProjectServer::useProject($project_id); | ||
| 149 | + $arr['inquiry_num'] = InquiryOther::count(); | ||
| 150 | + $countryData = InquiryOther::select("country",DB::raw('COUNT(*) as count'))->groupBy('country')->get()->toArray(); | ||
| 151 | + foreach ($countryData as $v1){ | ||
| 152 | + if(isset($countryArr[$v1['country']])){ | ||
| 153 | + $countryArr[$v1['country']] += $v1['count']; | ||
| 154 | + }else{ | ||
| 155 | + $countryArr[$v1['country']] = $v1['count']; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + | ||
| 144 | arsort($countryArr); | 160 | arsort($countryArr); |
| 145 | $top20 = array_slice($countryArr, 0, 20, true); | 161 | $top20 = array_slice($countryArr, 0, 20, true); |
| 146 | $arr['country'] = json_encode($top20); | 162 | $arr['country'] = json_encode($top20); |
| 147 | - } | ||
| 148 | return $arr; | 163 | return $arr; |
| 149 | } | 164 | } |
| 150 | 165 |
app/Console/Commands/Languages.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :Languages.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2023/11/30 10:29 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Console\Commands; | ||
| 11 | + | ||
| 12 | +use Illuminate\Console\Command; | ||
| 13 | + | ||
| 14 | +class Languages extends Command | ||
| 15 | +{ | ||
| 16 | + /** | ||
| 17 | + * The name and signature of the console command. | ||
| 18 | + * | ||
| 19 | + * @var string | ||
| 20 | + */ | ||
| 21 | + protected $signature = 'update_progress'; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * The console command description. | ||
| 25 | + * | ||
| 26 | + * @var string | ||
| 27 | + */ | ||
| 28 | + protected $description = '导入小语种'; | ||
| 29 | + /** | ||
| 30 | + * @name :(定时执行)handle | ||
| 31 | + * @author :lyh | ||
| 32 | + * @method :post | ||
| 33 | + * @time :2023/5/12 14:48 | ||
| 34 | + */ | ||
| 35 | + public function handle() | ||
| 36 | + { | ||
| 37 | + $data = '[{"short":"en","chinese":"英文","english":"English","language":"English"}, | ||
| 38 | + {"short":"zh","chinese":"简体中文","english":"Chinese","language":"Chinese Simplified"}, | ||
| 39 | + {"short":"zh-TW","chinese":"繁体中文","english":"Chinese","language":"Chinese Traditional"}, | ||
| 40 | + {"short":"fr","chinese":"法语","english":"French","language":"Français"}, | ||
| 41 | + {"short":"de","chinese":"德语","english":"German","language":"Deutsch"}, | ||
| 42 | + {"short":"pt","chinese":"葡萄牙语","english":"Portuguese","language":"Português"}, | ||
| 43 | + {"short":"es","chinese":"西班牙语","english":"Spanish","language":"Español"}, | ||
| 44 | + {"short":"ru","chinese":"俄语","english":"Russian","language":"Русский"}, | ||
| 45 | + {"short":"ja","chinese":"日语","english":"Japanese","language":"日本語"}, | ||
| 46 | + {"short":"ko","chinese":"韩语","english":"Korean","language":"한국어"}, | ||
| 47 | + {"short":"ar","chinese":"阿拉伯语","english":"Arabic","language":"العربية"}, | ||
| 48 | + {"short":"ga","chinese":"爱尔兰语","english":"Irish","language":"Gaeilge"}, | ||
| 49 | + {"short":"el","chinese":"希腊语","english":"Greek","language":"Ελληνικά"}, | ||
| 50 | + {"short":"tr","chinese":"土耳其语","english":"Turkish","language":"Türkçe"}, | ||
| 51 | + {"short":"it","chinese":"意大利语","english":"Italian","language":"Italiano"}, | ||
| 52 | + {"short":"da","chinese":"丹麦语","english":"Danish","language":"Dansk"}, | ||
| 53 | + {"short":"ro","chinese":"罗马尼亚语","english":"Romanian","language":"Română"}, | ||
| 54 | + {"short":"id","chinese":"印度尼西亚语","english":"Indonesian","language":"Bahasa Indonesia"}, | ||
| 55 | + {"short":"cs","chinese":"捷克语","english":"Czech","language":"Čeština"}, | ||
| 56 | + {"short":"af","chinese":"南非荷兰语","english":"Afrikaans","language":"Afrikaans"}, | ||
| 57 | + {"short":"sv","chinese":"瑞典语","english":"Swedish","language":"Svenska"}, | ||
| 58 | + {"short":"pl","chinese":"波兰语","english":"Polish","language":"Polski"}, | ||
| 59 | + {"short":"eu","chinese":"巴斯克语","english":"Basque","language":"Euskara"}, | ||
| 60 | + {"short":"ca","chinese":"加泰罗尼亚语","english":"Catalan","language":"Català"}, | ||
| 61 | + {"short":"eo","chinese":"世界语","english":"Esperanto","language":"Esperanto"}, | ||
| 62 | + {"short":"hi","chinese":"北印度语","english":"Hindi","language":"हिन्दी"}, | ||
| 63 | + {"short":"lo","chinese":"老挝语","english":"Lao","language":"Lao"}, | ||
| 64 | + {"short":"sq","chinese":"阿尔巴尼亚语","english":"Albanian","language":"Shqip"}, | ||
| 65 | + {"short":"am","chinese":"阿姆哈拉语","english":"Amharic","language":"አማርኛ"}, | ||
| 66 | + {"short":"hy","chinese":"亚美尼亚语","english":"Armenian","language":"Armenian"}, | ||
| 67 | + {"short":"az","chinese":"阿塞拜疆语","english":"Azerbaijani","language":"Azerbaijani"}, | ||
| 68 | + {"short":"be","chinese":"白俄罗斯语","english":"Belarusian","language":"беларуская м"}, | ||
| 69 | + {"short":"bn","chinese":"孟加拉语","english":"Bengali","language":"বাংলা"}, | ||
| 70 | + {"short":"bs","chinese":"波斯尼亚语","english":"Bosnian","language":"Bosnian"}, | ||
| 71 | + {"short":"bg","chinese":"保加利亚语","english":"Bulgarian","language":"Български"}, | ||
| 72 | + {"short":"ceb","chinese":"宿务语","english":"Cebuano","language":"Cebuano"}, | ||
| 73 | + {"short":"ny","chinese":"齐佩瓦语","english":"Chichewa","language":"Chichewa"}, | ||
| 74 | + {"short":"co","chinese":"科西嘉语","english":"Corsican","language":"Corsican"}, | ||
| 75 | + {"short":"hr","chinese":"克罗地亚语","english":"Croatian","language":"Hrvatski"}, | ||
| 76 | + {"short":"nl","chinese":"荷兰语","english":"Dutch","language":"Nederlands"}, | ||
| 77 | + {"short":"et","chinese":"爱沙尼亚语","english":"Estonian","language":"Eesti Keel"}, | ||
| 78 | + {"short":"tl","chinese":"菲律宾语","english":"Filipino","language":"Tagalog"}, | ||
| 79 | + {"short":"fi","chinese":"芬兰语","english":"Finnish","language":"Suomi"}, | ||
| 80 | + {"short":"fy","chinese":"弗利然语","english":"Frisian","language":"Frisian"}, | ||
| 81 | + {"short":"gl","chinese":"加利西亚语","english":"Galician","language":"Galego"}, | ||
| 82 | + {"short":"ka","chinese":"格鲁吉亚语","english":"Georgian","language":"ქართული"}, | ||
| 83 | + {"short":"gu","chinese":"古吉特拉语","english":"Gujarati","language":"ગુજરાતી"}, | ||
| 84 | + {"short":"ht","chinese":"海地-克里奥尔语","english":"Haitian","language":"Kreyòl Ayisyen"}, | ||
| 85 | + {"short":"ha","chinese":"豪撒语","english":"Hausa","language":"Hausa"}, | ||
| 86 | + {"short":"haw","chinese":"夏威夷语","english":"Hawaiian","language":"Hawaiian"}, | ||
| 87 | + {"short":"iw","chinese":"希伯来语","english":"Hebrew","language":"עברית"}, | ||
| 88 | + {"short":"hmn","chinese":"苗语","english":"Hmong","language":"Hmong"}, | ||
| 89 | + {"short":"hu","chinese":"匈牙利语","english":"Hungarian","language":"Magyar"}, | ||
| 90 | + {"short":"is","chinese":"冰岛语","english":"Icelandic","language":"Íslenska"}, | ||
| 91 | + {"short":"ig","chinese":"伊博语","english":"Igbo","language":"Igbo"}, | ||
| 92 | + {"short":"jw","chinese":"爪哇语","english":"Javanese","language":"Javanese"}, | ||
| 93 | + {"short":"kn","chinese":"坎纳达语","english":"Kannada","language":"ಕನ್ನಡ"}, | ||
| 94 | + {"short":"kk","chinese":"哈萨克语","english":"Kazakh","language":"Kazakh"}, | ||
| 95 | + {"short":"km","chinese":"高棉语","english":"Khmer","language":"Khmer"}, | ||
| 96 | + {"short":"ku","chinese":"库尔德语","english":"Kurdish","language":"ههرێمی کوردستان"}, | ||
| 97 | + {"short":"ky","chinese":"吉尔吉斯斯坦语","english":"Kyrgyz","language":"Kyrgyz"}, | ||
| 98 | + {"short":"la","chinese":"拉丁语","english":"Latin","language":"Latin"}, | ||
| 99 | + {"short":"lv","chinese":"拉脱维亚语","english":"Latvian","language":"Latviešu"}, | ||
| 100 | + {"short":"lt","chinese":"立陶宛语","english":"Lithuanian","language":"Lietuvių"}, | ||
| 101 | + {"short":"lb","chinese":"卢森堡语","english":"Luxembou..","language":"Herzogtum Lëtzebuerg"}, | ||
| 102 | + {"short":"mk","chinese":"马其顿语","english":"Macedonian","language":"македонски"}, | ||
| 103 | + {"short":"mg","chinese":"马尔加什语","english":"Malagasy","language":"Malagasy"}, | ||
| 104 | + {"short":"ms","chinese":"马来语","english":"Malay","language":"Bahasa Melayu"}, | ||
| 105 | + {"short":"ml","chinese":"德拉维族(Dravidian)语","english":"Malayalam","language":"Malayalam "}, | ||
| 106 | + {"short":"mt","chinese":"马其他语","english":"Maltese","language":"Malti"}, | ||
| 107 | + {"short":"mi","chinese":"毛利语","english":"Maori","language":"Maori"}, | ||
| 108 | + {"short":"mr","chinese":"马拉地语","english":"Marathi","language":"Marathi"}, | ||
| 109 | + {"short":"mn","chinese":"蒙古族语","english":"Mongolian","language":"Mongolian"}, | ||
| 110 | + {"short":"my","chinese":"缅甸语","english":"Burmese","language":"Burmese"}, | ||
| 111 | + {"short":"ne","chinese":"尼泊尔语","english":"Nepali","language":"Nepali"}, | ||
| 112 | + {"short":"no","chinese":"挪威语","english":"Norwegian","language":"Norsk"}, | ||
| 113 | + {"short":"ps","chinese":"普什图语","english":"Pashto","language":"Pashto"}, | ||
| 114 | + {"short":"fa","chinese":"波斯语","english":"Persian","language":"فارسی"}, | ||
| 115 | + {"short":"pa","chinese":"旁遮普语","english":"Punjabi","language":"Punjabi"}, | ||
| 116 | + {"short":"sr","chinese":"塞尔维亚语","english":"Serbian","language":"Српски"}, | ||
| 117 | + {"short":"st","chinese":"塞索托语","english":"Sesotho","language":"Sesotho"}, | ||
| 118 | + {"short":"si","chinese":"僧伽罗语","english":"Sinhala","language":"Sinhala"}, | ||
| 119 | + {"short":"sk","chinese":"斯洛伐克语","english":"Slovak","language":"Slovenčina"}, | ||
| 120 | + {"short":"sl","chinese":"斯洛文尼亚语","english":"Slovenian","language":"slovenščina"}, | ||
| 121 | + {"short":"so","chinese":"索马里语","english":"Somali","language":"Somali"}, | ||
| 122 | + {"short":"sm","chinese":"萨摩亚语","english":"Samoan","language":"Samoan"}, | ||
| 123 | + {"short":"gd","chinese":"苏格兰盖尔语","english":"Scots Gaelic","language":"Gàidhlig"}, | ||
| 124 | + {"short":"sn","chinese":"修纳语","english":"Shona","language":"Shona"}, | ||
| 125 | + {"short":"sd","chinese":"信德语","english":"Sindhi","language":"سنڌي"}, | ||
| 126 | + {"short":"su","chinese":"巽他语","english":"Sundanese","language":"Sundanese"}, | ||
| 127 | + {"short":"sw","chinese":"斯瓦西里语","english":"Swahili","language":"Kiswahili"}, | ||
| 128 | + {"short":"tg","chinese":"塔吉克语","english":"Tajik","language":"Tajik"}, | ||
| 129 | + {"short":"ta","chinese":"泰米尔语","english":"Tamil","language":"தமிழ்"}, | ||
| 130 | + {"short":"te","chinese":"泰卢固语","english":"Telugu","language":"తెలుగు"}, | ||
| 131 | + {"short":"th","chinese":"泰语","english":"Thai","language":"ภาษาไทย"}, | ||
| 132 | + {"short":"uk","chinese":"乌克兰语","english":"Ukrainian","language":"Українська"}, | ||
| 133 | + {"short":"ur","chinese":"乌尔都语","english":"Urdu","language":"اردو"}, | ||
| 134 | + {"short":"uz","chinese":"乌兹别克语","english":"Uzbek","language":"Uzbek"}, | ||
| 135 | + {"short":"vi","chinese":"越南语","english":"Vietnamese","language":"Tiếng Việt"}, | ||
| 136 | + {"short":"cy","chinese":"威尔士语","english":"Welsh","language":"Cymraeg"}, | ||
| 137 | + {"short":"xh","chinese":"科萨语","english":"Xhosa","language":"Xhosa"}, | ||
| 138 | + {"short":"yi","chinese":"意地绪语","english":"Yiddish","language":"ײִדיש"}, | ||
| 139 | + {"short":"yo","chinese":"约鲁巴语","english":"Yoruba","language":"Yoruba"}, | ||
| 140 | + {"short":"zu","chinese":"祖鲁语","english":"Zulu","language":"Zulu"}, | ||
| 141 | + {"short":"rw","english":"Kinyarwanda","chinese":"卢旺达","language":"Kinyarwanda"}, | ||
| 142 | + {"short":"tt","english":"Tatar","chinese":"鞑靼语","language":"Татар"}, | ||
| 143 | + {"short":"or","english":"Oriya","chinese":"奥利亚语","language":"ଓଡିଆ"}, | ||
| 144 | + {"short":"tk","english":"Turkmen","chinese":"土库曼语","language":"Türkmenler"}, | ||
| 145 | + {"short":"ug","english":"Uyghur","chinese":"维吾尔语","language":"ئۇيغۇر"}]'; | ||
| 146 | + } | ||
| 147 | +} |
| @@ -4,6 +4,7 @@ namespace App\Console\Commands\MonthlyCount; | @@ -4,6 +4,7 @@ namespace App\Console\Commands\MonthlyCount; | ||
| 4 | 4 | ||
| 5 | use App\Helper\FormGlobalsoApi; | 5 | use App\Helper\FormGlobalsoApi; |
| 6 | use App\Models\Domain\DomainInfo; | 6 | use App\Models\Domain\DomainInfo; |
| 7 | +use App\Models\Inquiry\InquiryOther; | ||
| 7 | use App\Models\Project\Project; | 8 | use App\Models\Project\Project; |
| 8 | use App\Services\ProjectServer; | 9 | use App\Services\ProjectServer; |
| 9 | use Carbon\Carbon; | 10 | use Carbon\Carbon; |
| @@ -54,12 +55,12 @@ class InquiryMonthlyCount extends Command | @@ -54,12 +55,12 @@ class InquiryMonthlyCount extends Command | ||
| 54 | if(!empty($value['domain'])){ | 55 | if(!empty($value['domain'])){ |
| 55 | $info = $domainInfo->read(['id'=>$value['domain']]); | 56 | $info = $domainInfo->read(['id'=>$value['domain']]); |
| 56 | if($info !== false){ | 57 | if($info !== false){ |
| 57 | - $value['test_domain'] = $value['domain']; | 58 | + $value['test_domain'] = $info['domain']; |
| 58 | } | 59 | } |
| 59 | } | 60 | } |
| 60 | $arr = []; | 61 | $arr = []; |
| 61 | //按月统计询盘记录 | 62 | //按月统计询盘记录 |
| 62 | - $arr = $this->inquiryCount($arr,$startTime,$endTime,$value['test_domain']); | 63 | + $arr = $this->inquiryCount($arr,$startTime,$endTime,$value['test_domain'],$value['project_id']); |
| 63 | $arr = $this->flowCount($arr,$startTime,$endTime,$value['project_id']); | 64 | $arr = $this->flowCount($arr,$startTime,$endTime,$value['project_id']); |
| 64 | ProjectServer::useProject($value['project_id']); | 65 | ProjectServer::useProject($value['project_id']); |
| 65 | $arr = $this->sourceCount($arr,$value['test_domain'],$startTime,$endTime); | 66 | $arr = $this->sourceCount($arr,$value['test_domain'],$startTime,$endTime); |
| @@ -83,7 +84,7 @@ class InquiryMonthlyCount extends Command | @@ -83,7 +84,7 @@ class InquiryMonthlyCount extends Command | ||
| 83 | * @method :post | 84 | * @method :post |
| 84 | * @time :2023/6/30 14:29 | 85 | * @time :2023/6/30 14:29 |
| 85 | */ | 86 | */ |
| 86 | - public function inquiryCount(&$arr,&$startTime,&$endTime,$domain){ | 87 | + public function inquiryCount(&$arr,&$startTime,&$endTime,$domain,$project_id){ |
| 87 | $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); | 88 | $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); |
| 88 | //总数 | 89 | //总数 |
| 89 | $arr['total'] = $inquiry_list['data']['total'] ?? 0; | 90 | $arr['total'] = $inquiry_list['data']['total'] ?? 0; |
| @@ -96,17 +97,32 @@ class InquiryMonthlyCount extends Command | @@ -96,17 +97,32 @@ class InquiryMonthlyCount extends Command | ||
| 96 | foreach ($data as $v){ | 97 | foreach ($data as $v){ |
| 97 | if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){ | 98 | if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){ |
| 98 | $arr['month_total']++; | 99 | $arr['month_total']++; |
| 99 | - } | ||
| 100 | if(isset($countryArr[$v['country']])){ | 100 | if(isset($countryArr[$v['country']])){ |
| 101 | $countryArr[$v['country']]++; | 101 | $countryArr[$v['country']]++; |
| 102 | }else{ | 102 | }else{ |
| 103 | - $countryArr[$v['country']] = 0; | 103 | + $countryArr[$v['country']] = 1; |
| 104 | + } | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + //加上其他询盘 | ||
| 109 | + ProjectServer::useProject($project_id); | ||
| 110 | + $arr['total'] += InquiryOther::count(); | ||
| 111 | + $arr['month_total'] += InquiryOther::whereBetween('submit_time',[$startTime, $endTime])->count(); | ||
| 112 | + $countryData = InquiryOther::whereBetween('submit_time',[$startTime, $endTime]) | ||
| 113 | + ->select("country",DB::raw('COUNT(*) as count')) | ||
| 114 | + ->groupBy('country')->get()->toArray(); | ||
| 115 | + foreach ($countryData as $v1){ | ||
| 116 | + if(isset($countryArr[$v1['country']])){ | ||
| 117 | + $countryArr[$v1['country']] += $v1['count']; | ||
| 118 | + }else{ | ||
| 119 | + $countryArr[$v1['country']] = $v1['count']; | ||
| 104 | } | 120 | } |
| 105 | } | 121 | } |
| 122 | + | ||
| 106 | arsort($countryArr); | 123 | arsort($countryArr); |
| 107 | $top20 = array_slice($countryArr, 0, 15, true); | 124 | $top20 = array_slice($countryArr, 0, 15, true); |
| 108 | $arr['country'] = json_encode($top20); | 125 | $arr['country'] = json_encode($top20); |
| 109 | - } | ||
| 110 | return $arr; | 126 | return $arr; |
| 111 | } | 127 | } |
| 112 | 128 |
| @@ -10,6 +10,7 @@ namespace App\Console\Commands\Test; | @@ -10,6 +10,7 @@ namespace App\Console\Commands\Test; | ||
| 10 | use App\Helper\Common; | 10 | use App\Helper\Common; |
| 11 | use App\Models\Blog\Blog; | 11 | use App\Models\Blog\Blog; |
| 12 | use App\Models\Devops\ServerConfig; | 12 | use App\Models\Devops\ServerConfig; |
| 13 | +use App\Models\Domain\DomainInfo; | ||
| 13 | use App\Models\File\Image; | 14 | use App\Models\File\Image; |
| 14 | use App\Models\Manage\BelongingGroup; | 15 | use App\Models\Manage\BelongingGroup; |
| 15 | use App\Models\Manage\Dept; | 16 | use App\Models\Manage\Dept; |
| @@ -43,10 +44,10 @@ class Demo extends Command | @@ -43,10 +44,10 @@ class Demo extends Command | ||
| 43 | * | 44 | * |
| 44 | * @return void | 45 | * @return void |
| 45 | */ | 46 | */ |
| 46 | - public function __construct() | ||
| 47 | - { | ||
| 48 | - parent::__construct(); | ||
| 49 | - } | 47 | +// public function __construct() |
| 48 | +// { | ||
| 49 | +// parent::__construct(); | ||
| 50 | +// } | ||
| 50 | 51 | ||
| 51 | public function curlRequest($url, $data, $method = 'POST', $header = [], $time_out = 60) | 52 | public function curlRequest($url, $data, $method = 'POST', $header = [], $time_out = 60) |
| 52 | { | 53 | { |
| @@ -77,6 +78,7 @@ class Demo extends Command | @@ -77,6 +78,7 @@ class Demo extends Command | ||
| 77 | */ | 78 | */ |
| 78 | public function handle() | 79 | public function handle() |
| 79 | { | 80 | { |
| 81 | + return $this->domain(); | ||
| 80 | $result = app(SyncService::class)->projectAcceptAddress(1); | 82 | $result = app(SyncService::class)->projectAcceptAddress(1); |
| 81 | dd($result); | 83 | dd($result); |
| 82 | $data = [ | 84 | $data = [ |
| @@ -293,4 +295,26 @@ class Demo extends Command | @@ -293,4 +295,26 @@ class Demo extends Command | ||
| 293 | } | 295 | } |
| 294 | dd(1); | 296 | dd(1); |
| 295 | } | 297 | } |
| 298 | + | ||
| 299 | + /** | ||
| 300 | + * @remark :获取域名 | ||
| 301 | + * @name :domain | ||
| 302 | + * @author :lyh | ||
| 303 | + * @method :post | ||
| 304 | + * @time :2023/11/29 18:47 | ||
| 305 | + */ | ||
| 306 | + public function domain(){ | ||
| 307 | + $domainModel = new DomainInfo(); | ||
| 308 | + $lists = $domainModel->list(); | ||
| 309 | + foreach ($lists as $k => $v){ | ||
| 310 | + if($v['project_id'] != 0){ | ||
| 311 | + echo date('Y-m-d H:i:s') . ' start: ' . $v['project_id'] . PHP_EOL; | ||
| 312 | + $domain = 'https://'.$v['domain'].'/'; | ||
| 313 | + $url = $domain.'/api/update_robots/?project_id='.$v['project_id']; | ||
| 314 | + http_get($url); | ||
| 315 | + echo date('Y-m-d H:i:s') . ' end: ' . $v['project_id'] . PHP_EOL; | ||
| 316 | + } | ||
| 317 | + } | ||
| 318 | + return true; | ||
| 319 | + } | ||
| 296 | } | 320 | } |
| @@ -83,6 +83,7 @@ class OnlineController extends BaseController | @@ -83,6 +83,7 @@ class OnlineController extends BaseController | ||
| 83 | 'gl_project_deploy_optimize.assist_mid AS optimize_assist_mid', | 83 | 'gl_project_deploy_optimize.assist_mid AS optimize_assist_mid', |
| 84 | 'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid', | 84 | 'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid', |
| 85 | 'gl_project_deploy_optimize.domain AS domain', | 85 | 'gl_project_deploy_optimize.domain AS domain', |
| 86 | + 'gl_project_deploy_optimize.quality_mid AS quality_mid', | ||
| 86 | ]; | 87 | ]; |
| 87 | return $select; | 88 | return $select; |
| 88 | } | 89 | } |
| @@ -108,6 +109,7 @@ class OnlineController extends BaseController | @@ -108,6 +109,7 @@ class OnlineController extends BaseController | ||
| 108 | $item['optimize_optimist'] = $manageModel->getName($item['optimize_optimist_mid']); | 109 | $item['optimize_optimist'] = $manageModel->getName($item['optimize_optimist_mid']); |
| 109 | $item['optimize_assist'] = $manageModel->getName($item['optimize_assist_mid']); | 110 | $item['optimize_assist'] = $manageModel->getName($item['optimize_assist_mid']); |
| 110 | $item['optimize_tech'] = $manageModel->getName($item['optimize_tech_mid']); | 111 | $item['optimize_tech'] = $manageModel->getName($item['optimize_tech_mid']); |
| 112 | + $item['quality_mid_name'] = $manageModel->getName($item['quality_mid']); | ||
| 111 | $item['plan'] = Project::planMap()[$item['plan']]; | 113 | $item['plan'] = Project::planMap()[$item['plan']]; |
| 112 | $item['created_at'] = date('Y年m月d日', strtotime($item['created_at'])); | 114 | $item['created_at'] = date('Y年m月d日', strtotime($item['created_at'])); |
| 113 | $item['autologin_code'] = getAutoLoginCode($item['id']); | 115 | $item['autologin_code'] = getAutoLoginCode($item['id']); |
| @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Aside\Optimize; | @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Aside\Optimize; | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Http\Controllers\Aside\BaseController; | 6 | use App\Http\Controllers\Aside\BaseController; |
| 7 | use App\Http\Logic\Aside\Optimize\OptimizeLogic; | 7 | use App\Http\Logic\Aside\Optimize\OptimizeLogic; |
| 8 | +use App\Http\Logic\Aside\Project\ProjectLogic; | ||
| 8 | use App\Models\Ai\AiPrefix; | 9 | use App\Models\Ai\AiPrefix; |
| 9 | use App\Models\ASide\APublicModel; | 10 | use App\Models\ASide\APublicModel; |
| 10 | use App\Models\Channel\Channel; | 11 | use App\Models\Channel\Channel; |
| @@ -73,6 +74,7 @@ class OptimizeController extends BaseController | @@ -73,6 +74,7 @@ class OptimizeController extends BaseController | ||
| 73 | $item['optimize_optimist'] = $manageModel->getName($item['optimize_optimist_mid']); | 74 | $item['optimize_optimist'] = $manageModel->getName($item['optimize_optimist_mid']); |
| 74 | $item['optimize_assist'] = $manageModel->getName($item['optimize_assist_mid']); | 75 | $item['optimize_assist'] = $manageModel->getName($item['optimize_assist_mid']); |
| 75 | $item['optimize_tech'] = $manageModel->getName($item['optimize_tech_mid']); | 76 | $item['optimize_tech'] = $manageModel->getName($item['optimize_tech_mid']); |
| 77 | + $item['quality_mid_name'] = $manageModel->getName($item['quality_mid']); | ||
| 76 | $item['plan'] = Project::planMap()[$item['plan']]; | 78 | $item['plan'] = Project::planMap()[$item['plan']]; |
| 77 | $item['created_at'] = date('Y年m月d日', strtotime($item['cooperate_date'])); | 79 | $item['created_at'] = date('Y年m月d日', strtotime($item['cooperate_date'])); |
| 78 | $item['autologin_code'] = getAutoLoginCode($item['id']); | 80 | $item['autologin_code'] = getAutoLoginCode($item['id']); |
| @@ -244,9 +246,20 @@ class OptimizeController extends BaseController | @@ -244,9 +246,20 @@ class OptimizeController extends BaseController | ||
| 244 | $projectModel = new Project(); | 246 | $projectModel = new Project(); |
| 245 | $rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]); | 247 | $rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]); |
| 246 | if($rs === false){ | 248 | if($rs === false){ |
| 247 | - $this->response('系统错误,请联系管理员',Code::SYSTEM_ERROR); | 249 | + $this->response('执行错误,请联系开发人员',Code::SYSTEM_ERROR); |
| 248 | } | 250 | } |
| 249 | //TODO::通知C端 | 251 | //TODO::通知C端 |
| 250 | - $this->response('success'); | 252 | + $projectLogic = new ProjectLogic(); |
| 253 | + $project = $projectLogic->getProjectInfo($this->param['project_id']); | ||
| 254 | + $domain = !empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''; | ||
| 255 | + if(empty($domain)){ | ||
| 256 | + $domain = $project['deploy_build']['test_domain']; | ||
| 257 | + } | ||
| 258 | + $url = $domain.'api/update_robots/?project_id='.$this->param['project_id']; | ||
| 259 | + $res = curlGet($url); | ||
| 260 | + if(empty($res) || $res['status'] != 200){ | ||
| 261 | + $this->response('生成robots失败,请联系开发人员',Code::SYSTEM_ERROR,['url'=>$url]); | ||
| 262 | + } | ||
| 263 | + $this->response('success',Code::SUCCESS,['url'=>$domain.'robots.txt']); | ||
| 251 | } | 264 | } |
| 252 | } | 265 | } |
| @@ -310,6 +310,7 @@ class ProjectController extends BaseController | @@ -310,6 +310,7 @@ class ProjectController extends BaseController | ||
| 310 | $item['optimize_optimist'] = $manageModel->getName($item['optimize_optimist_mid']); | 310 | $item['optimize_optimist'] = $manageModel->getName($item['optimize_optimist_mid']); |
| 311 | $item['optimize_assist'] = $manageModel->getName($item['optimize_assist_mid']); | 311 | $item['optimize_assist'] = $manageModel->getName($item['optimize_assist_mid']); |
| 312 | $item['optimize_tech'] = $manageModel->getName($item['optimize_tech_mid']); | 312 | $item['optimize_tech'] = $manageModel->getName($item['optimize_tech_mid']); |
| 313 | + $item['quality_mid_name'] = $manageModel->getName($item['quality_mid']); | ||
| 313 | $item['plan'] = Project::planMap()[$item['plan']]; | 314 | $item['plan'] = Project::planMap()[$item['plan']]; |
| 314 | $item['created_at'] = date('Y年m月d日', strtotime($item['cooperate_date'])); | 315 | $item['created_at'] = date('Y年m月d日', strtotime($item['cooperate_date'])); |
| 315 | $item['autologin_code'] = getAutoLoginCode($item['id']); | 316 | $item['autologin_code'] = getAutoLoginCode($item['id']); |
| @@ -22,7 +22,11 @@ class InquiryController extends BaseController | @@ -22,7 +22,11 @@ class InquiryController extends BaseController | ||
| 22 | 22 | ||
| 23 | public function index(InquiryLogic $logic) | 23 | public function index(InquiryLogic $logic) |
| 24 | { | 24 | { |
| 25 | + if(($this->param['type']??'') == 'other'){ | ||
| 26 | + $data = $logic->getOtherList(); | ||
| 27 | + }else{ | ||
| 25 | $data = $logic->getApiList(); | 28 | $data = $logic->getApiList(); |
| 29 | + } | ||
| 26 | return $this->success($data); | 30 | return $this->success($data); |
| 27 | } | 31 | } |
| 28 | 32 | ||
| @@ -32,7 +36,12 @@ class InquiryController extends BaseController | @@ -32,7 +36,12 @@ class InquiryController extends BaseController | ||
| 32 | ],[ | 36 | ],[ |
| 33 | 'id.required' => 'ID不能为空' | 37 | 'id.required' => 'ID不能为空' |
| 34 | ]); | 38 | ]); |
| 39 | + if(($this->param['type']??'') == 'other'){ | ||
| 40 | + $data = $logic->getOtherInfo($this->param['id']); | ||
| 41 | + }else{ | ||
| 35 | $data = $logic->getInfo($this->param['id']); | 42 | $data = $logic->getInfo($this->param['id']); |
| 43 | + } | ||
| 44 | + | ||
| 36 | return $this->success($data); | 45 | return $this->success($data); |
| 37 | } | 46 | } |
| 38 | 47 | ||
| @@ -43,8 +52,12 @@ class InquiryController extends BaseController | @@ -43,8 +52,12 @@ class InquiryController extends BaseController | ||
| 43 | ],[ | 52 | ],[ |
| 44 | 'ids.required' => 'ID不能为空' | 53 | 'ids.required' => 'ID不能为空' |
| 45 | ]); | 54 | ]); |
| 46 | - | 55 | + if(($this->param['type']??'') == 'other'){ |
| 56 | + $logic->deleteOther($this->param['ids']); | ||
| 57 | + }else{ | ||
| 47 | $logic->delete($this->param['ids']); | 58 | $logic->delete($this->param['ids']); |
| 59 | + } | ||
| 60 | + | ||
| 48 | return $this->success(); | 61 | return $this->success(); |
| 49 | } | 62 | } |
| 50 | 63 | ||
| @@ -58,12 +71,16 @@ class InquiryController extends BaseController | @@ -58,12 +71,16 @@ class InquiryController extends BaseController | ||
| 58 | */ | 71 | */ |
| 59 | public function export(InquiryLogic $logic) | 72 | public function export(InquiryLogic $logic) |
| 60 | { | 73 | { |
| 74 | + if(($this->param['type']??'') == 'other'){ | ||
| 75 | + $data = $logic->getOtherList(true); | ||
| 76 | + $map = [ | ||
| 77 | + 'submit_time' => '询盘发送时间', | ||
| 78 | + 'email' => '邮箱', | ||
| 79 | + 'ip_address' => '访问国家/地区(IP)', | ||
| 80 | + 'referer' => '发送页面', | ||
| 81 | + ]; | ||
| 82 | + }else{ | ||
| 61 | $data = $logic->getApiList(true); | 83 | $data = $logic->getApiList(true); |
| 62 | - $data = $data['list'] ?? []; | ||
| 63 | - foreach ($data as &$item){ | ||
| 64 | - $item['ip_address'] = "{$item['country']}({$item['ip']})"; | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | $map = [ | 84 | $map = [ |
| 68 | 'submit_time' => '询盘发送时间', | 85 | 'submit_time' => '询盘发送时间', |
| 69 | 'name' => '姓名', | 86 | 'name' => '姓名', |
| @@ -73,6 +90,12 @@ class InquiryController extends BaseController | @@ -73,6 +90,12 @@ class InquiryController extends BaseController | ||
| 73 | 'refer' => '发送页面', | 90 | 'refer' => '发送页面', |
| 74 | 'message' => '询盘内容', | 91 | 'message' => '询盘内容', |
| 75 | ]; | 92 | ]; |
| 93 | + } | ||
| 94 | + | ||
| 95 | + $data = $data['list'] ?? []; | ||
| 96 | + foreach ($data as &$item){ | ||
| 97 | + $item['ip_address'] = "{$item['country']}({$item['ip']})"; | ||
| 98 | + } | ||
| 76 | 99 | ||
| 77 | //生成文件,发送到客户端 | 100 | //生成文件,发送到客户端 |
| 78 | $table = new BatchExportService("询盘数据导出"); | 101 | $table = new BatchExportService("询盘数据导出"); |
| @@ -63,6 +63,10 @@ class BTemplateLogLogic extends BaseLogic | @@ -63,6 +63,10 @@ class BTemplateLogLogic extends BaseLogic | ||
| 63 | //更新所有界面的other | 63 | //更新所有界面的other |
| 64 | if(!empty($info['other'])){ | 64 | if(!empty($info['other'])){ |
| 65 | $commonTemplateModel->edit(['other'=>$info['other']],['project_id'=>$this->user['project_id'],'template_id'=>$info['template_id']]); | 65 | $commonTemplateModel->edit(['other'=>$info['other']],['project_id'=>$this->user['project_id'],'template_id'=>$info['template_id']]); |
| 66 | + }else{ | ||
| 67 | + $footer_other = str_replace('<header','',characterTruncation($info['text'],'/<style id="globalsojs-footer">(.*?)<header/s')); | ||
| 68 | + $other = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); | ||
| 69 | + $commonTemplateModel->edit(['other'=>$other],['project_id'=>$this->user['project_id'],'template_id'=>$info['template_id']]); | ||
| 66 | } | 70 | } |
| 67 | }catch (\Exception $e){ | 71 | }catch (\Exception $e){ |
| 68 | $this->fail('系统错误,请联系管理员'); | 72 | $this->fail('系统错误,请联系管理员'); |
| @@ -115,7 +119,8 @@ class BTemplateLogLogic extends BaseLogic | @@ -115,7 +119,8 @@ class BTemplateLogLogic extends BaseLogic | ||
| 115 | $this->fail('当前数据不存在,或已被删除'); | 119 | $this->fail('当前数据不存在,或已被删除'); |
| 116 | } | 120 | } |
| 117 | if(empty($info['other'])){ | 121 | if(empty($info['other'])){ |
| 118 | - $info['other'] = str_replace('<header','',characterTruncation($info['text'],"/<link id=\"google-fonts-link\"(.*?)<header/s"));; | 122 | + $footer_other = str_replace('<header','',characterTruncation($info['text'],'/<style id="globalsojs-footer">(.*?)<header/s')); |
| 123 | + $info['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); | ||
| 119 | } | 124 | } |
| 120 | $html = $info['head_css'].$info['main_css'].$info['footer_css'].$info['other']. | 125 | $html = $info['head_css'].$info['main_css'].$info['footer_css'].$info['other']. |
| 121 | $info['head_html'].$info['main_html'].$info['footer_html']; | 126 | $info['head_html'].$info['main_html'].$info['footer_html']; |
| @@ -277,7 +277,8 @@ class BTemplateLogic extends BaseLogic | @@ -277,7 +277,8 @@ class BTemplateLogic extends BaseLogic | ||
| 277 | 'footer_html'=>$param['footer_html'], | 277 | 'footer_html'=>$param['footer_html'], |
| 278 | 'footer_css'=>$param['footer_css'], | 278 | 'footer_css'=>$param['footer_css'], |
| 279 | ]; | 279 | ]; |
| 280 | - $other = str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")); | 280 | + $footer_other = str_replace('<header','',characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<header/s')); |
| 281 | + $other = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); | ||
| 281 | if($info === false){ | 282 | if($info === false){ |
| 282 | $data['template_id'] = $param['template_id']; | 283 | $data['template_id'] = $param['template_id']; |
| 283 | $data['project_id'] = $this->user['project_id']; | 284 | $data['project_id'] = $this->user['project_id']; |
| @@ -335,8 +336,9 @@ class BTemplateLogic extends BaseLogic | @@ -335,8 +336,9 @@ class BTemplateLogic extends BaseLogic | ||
| 335 | 'main_css'=>$param['main_css'], | 336 | 'main_css'=>$param['main_css'], |
| 336 | 'footer_html'=>$param['footer_html'], | 337 | 'footer_html'=>$param['footer_html'], |
| 337 | 'footer_css'=>$param['footer_css'], | 338 | 'footer_css'=>$param['footer_css'], |
| 338 | - 'other'=> str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")) | ||
| 339 | ]; | 339 | ]; |
| 340 | + $footer_other = str_replace('<header','',characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<header/s')); | ||
| 341 | + $data['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); | ||
| 340 | $bTemplateLogModel = new BTemplateLog(); | 342 | $bTemplateLogModel = new BTemplateLog(); |
| 341 | return $bTemplateLogModel->add($data); | 343 | return $bTemplateLogModel->add($data); |
| 342 | } | 344 | } |
| @@ -136,8 +136,9 @@ class CustomTemplateLogic extends BaseLogic | @@ -136,8 +136,9 @@ class CustomTemplateLogic extends BaseLogic | ||
| 136 | 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'), | 136 | 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'), |
| 137 | 'main_html' => characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s'), | 137 | 'main_html' => characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s'), |
| 138 | 'main_css' => characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s'), | 138 | 'main_css' => characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s'), |
| 139 | - 'other'=> str_replace('<header','',characterTruncation($html,"/<link id=\"google-fonts-link\"(.*?)<header/s")) | ||
| 140 | ]; | 139 | ]; |
| 140 | + $footer_other = str_replace('<header','',characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<header/s')); | ||
| 141 | + $data['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); | ||
| 141 | $bTemplateLogModel = new BTemplateLog(); | 142 | $bTemplateLogModel = new BTemplateLog(); |
| 142 | return $bTemplateLogModel->add($data); | 143 | return $bTemplateLogModel->add($data); |
| 143 | } | 144 | } |
| @@ -151,7 +152,6 @@ class CustomTemplateLogic extends BaseLogic | @@ -151,7 +152,6 @@ class CustomTemplateLogic extends BaseLogic | ||
| 151 | */ | 152 | */ |
| 152 | public function saveCommonTemplate($html,$template_id){ | 153 | public function saveCommonTemplate($html,$template_id){ |
| 153 | $type = $this->getType(); | 154 | $type = $this->getType(); |
| 154 | - | ||
| 155 | $templateCommonModel = new BTemplateCommon(); | 155 | $templateCommonModel = new BTemplateCommon(); |
| 156 | $info = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type]); | 156 | $info = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type]); |
| 157 | $data = [ | 157 | $data = [ |
| @@ -160,7 +160,8 @@ class CustomTemplateLogic extends BaseLogic | @@ -160,7 +160,8 @@ class CustomTemplateLogic extends BaseLogic | ||
| 160 | 'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'), | 160 | 'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'), |
| 161 | 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'), | 161 | 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'), |
| 162 | ]; | 162 | ]; |
| 163 | - $other = str_replace('<header','',characterTruncation($html,"/<link id=\"google-fonts-link\"(.*?)<header/s")); | 163 | + $footer_other = str_replace('<header','',characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<header/s')); |
| 164 | + $other = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); | ||
| 164 | if($info === false){ | 165 | if($info === false){ |
| 165 | $data['template_id'] = $template_id; | 166 | $data['template_id'] = $template_id; |
| 166 | $data['project_id'] = $this->user['project_id']; | 167 | $data['project_id'] = $this->user['project_id']; |
| @@ -341,6 +341,8 @@ class VisualizationLogic extends BaseLogic | @@ -341,6 +341,8 @@ class VisualizationLogic extends BaseLogic | ||
| 341 | 'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'), | 341 | 'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'), |
| 342 | 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'), | 342 | 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'), |
| 343 | ]; | 343 | ]; |
| 344 | + $footer_other = str_replace('<header','',characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<header/s')); | ||
| 345 | + $data['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); | ||
| 344 | $bTemplateLogModel = new BTemplateLog(); | 346 | $bTemplateLogModel = new BTemplateLog(); |
| 345 | return $bTemplateLogModel->add($data); | 347 | return $bTemplateLogModel->add($data); |
| 346 | } | 348 | } |
| @@ -362,7 +364,8 @@ class VisualizationLogic extends BaseLogic | @@ -362,7 +364,8 @@ class VisualizationLogic extends BaseLogic | ||
| 362 | 'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'), | 364 | 'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'), |
| 363 | 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'), | 365 | 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'), |
| 364 | ]; | 366 | ]; |
| 365 | - $other = str_replace('<header','',characterTruncation($html,"/<link id=\"google-fonts-link\"(.*?)<header/s")); | 367 | + $footer_other = str_replace('<header','',characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<header/s')); |
| 368 | + $other = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); | ||
| 366 | if($info === false){ | 369 | if($info === false){ |
| 367 | $data['template_id'] = $template_id; | 370 | $data['template_id'] = $template_id; |
| 368 | $data['project_id'] = $this->user['project_id']; | 371 | $data['project_id'] = $this->user['project_id']; |
| @@ -8,6 +8,9 @@ use App\Helper\Translate; | @@ -8,6 +8,9 @@ use App\Helper\Translate; | ||
| 8 | use App\Http\Logic\Aside\Project\ProjectLogic; | 8 | use App\Http\Logic\Aside\Project\ProjectLogic; |
| 9 | use App\Http\Logic\Bside\BaseLogic; | 9 | use App\Http\Logic\Bside\BaseLogic; |
| 10 | use App\Models\Domain\DomainInfo; | 10 | use App\Models\Domain\DomainInfo; |
| 11 | +use App\Models\Inquiry\InquiryOther; | ||
| 12 | +use App\Services\ProjectServer; | ||
| 13 | +use Illuminate\Support\Facades\DB; | ||
| 11 | 14 | ||
| 12 | /** | 15 | /** |
| 13 | * Class InquiryLogic | 16 | * Class InquiryLogic |
| @@ -28,7 +31,11 @@ class InquiryLogic extends BaseLogic | @@ -28,7 +31,11 @@ class InquiryLogic extends BaseLogic | ||
| 28 | 31 | ||
| 29 | public function getApiList($export = false) | 32 | public function getApiList($export = false) |
| 30 | { | 33 | { |
| 34 | + if(isset($this->request['row'])){ | ||
| 35 | + $page_size = $this->request['row']; | ||
| 36 | + }else{ | ||
| 31 | $page_size = $export ? 1000 : 20; | 37 | $page_size = $export ? 1000 : 20; |
| 38 | + } | ||
| 32 | $search = $this->request['search'] ?: ''; | 39 | $search = $this->request['search'] ?: ''; |
| 33 | $page = $this->request['page'] ?: 1; | 40 | $page = $this->request['page'] ?: 1; |
| 34 | $project = (new ProjectLogic())->getProjectInfo($this->user['project_id']); | 41 | $project = (new ProjectLogic())->getProjectInfo($this->user['project_id']); |
| @@ -53,6 +60,23 @@ class InquiryLogic extends BaseLogic | @@ -53,6 +60,23 @@ class InquiryLogic extends BaseLogic | ||
| 53 | return $this->success($data); | 60 | return $this->success($data); |
| 54 | } | 61 | } |
| 55 | 62 | ||
| 63 | + public function getOtherList($export = false){ | ||
| 64 | + $page_size = $export ? 1000 : 20; | ||
| 65 | + $search = $this->request['search'] ?: ''; | ||
| 66 | + $page = $this->request['page'] ?: 1; | ||
| 67 | + $map = []; | ||
| 68 | + if($search){ | ||
| 69 | + $map['email'] = ['like','%'.$search.'%']; | ||
| 70 | + } | ||
| 71 | + ProjectServer::useProject($this->user['project_id']); | ||
| 72 | + | ||
| 73 | + $data = (new InquiryOther())->lists($map,$page,$page_size,'id', | ||
| 74 | + ['id', 'email', 'ip', 'country', 'domain', DB::raw('referer as refer'), DB::raw('status as read_status'), 'submit_time'] | ||
| 75 | + ); | ||
| 76 | + | ||
| 77 | + return $this->success($data); | ||
| 78 | + } | ||
| 79 | + | ||
| 56 | public function getInfo($id) | 80 | public function getInfo($id) |
| 57 | { | 81 | { |
| 58 | $project = (new ProjectLogic())->getProjectInfo($this->user['project_id']); | 82 | $project = (new ProjectLogic())->getProjectInfo($this->user['project_id']); |
| @@ -69,6 +93,15 @@ class InquiryLogic extends BaseLogic | @@ -69,6 +93,15 @@ class InquiryLogic extends BaseLogic | ||
| 69 | return $this->success(['trans_message' => $trans_message]); | 93 | return $this->success(['trans_message' => $trans_message]); |
| 70 | } | 94 | } |
| 71 | 95 | ||
| 96 | + public function getOtherInfo($id){ | ||
| 97 | + //修改状态为已读 | ||
| 98 | + if($this->request['read_status']){ | ||
| 99 | + ProjectServer::useProject($this->user['project_id']); | ||
| 100 | + (new InquiryOther())->edit(['status' => 1], ['id' => $id]); | ||
| 101 | + } | ||
| 102 | + return $this->success(['trans_message' => '']); | ||
| 103 | + } | ||
| 104 | + | ||
| 72 | public function delete($ids, $map = []) | 105 | public function delete($ids, $map = []) |
| 73 | { | 106 | { |
| 74 | $project = (new ProjectLogic())->getProjectInfo($this->user['project_id']); | 107 | $project = (new ProjectLogic())->getProjectInfo($this->user['project_id']); |
| @@ -81,6 +114,16 @@ class InquiryLogic extends BaseLogic | @@ -81,6 +114,16 @@ class InquiryLogic extends BaseLogic | ||
| 81 | return $this->success(); | 114 | return $this->success(); |
| 82 | } | 115 | } |
| 83 | 116 | ||
| 117 | + public function deleteOther($ids, $map = []) | ||
| 118 | + { | ||
| 119 | + $ids = array_filter(Arr::splitFilterToArray($ids), 'intval'); | ||
| 120 | + if(!$ids){ | ||
| 121 | + $this->fail('ID不能为空'); | ||
| 122 | + } | ||
| 123 | + ProjectServer::useProject($this->user['project_id']); | ||
| 124 | + (new InquiryOther())->del(['id'=>['in',$ids]]); | ||
| 125 | + return $this->success(); | ||
| 126 | + } | ||
| 84 | 127 | ||
| 85 | 128 | ||
| 86 | 129 |
| @@ -24,12 +24,7 @@ class WebSettingCountryLogic extends BaseLogic | @@ -24,12 +24,7 @@ class WebSettingCountryLogic extends BaseLogic | ||
| 24 | * @time :2023/4/28 16:18 | 24 | * @time :2023/4/28 16:18 |
| 25 | */ | 25 | */ |
| 26 | public function country_list(){ | 26 | public function country_list(){ |
| 27 | - $lists = $this->model->list($this->param,'id',['id','name','country_img']); | ||
| 28 | - if (!empty($lists)){ | ||
| 29 | - foreach ($lists as $k => $v){ | ||
| 30 | - $lists[$k]['image_link'] = url('upload/country/' . $v['country_img']); | ||
| 31 | - } | ||
| 32 | - } | 27 | + $lists = $this->model->list($this->param,'id',['id','name','alias','lang_text']); |
| 33 | return $this->success($lists); | 28 | return $this->success($lists); |
| 34 | } | 29 | } |
| 35 | 30 |
| @@ -24,7 +24,7 @@ class VisitLogic extends BaseLogic | @@ -24,7 +24,7 @@ class VisitLogic extends BaseLogic | ||
| 24 | 24 | ||
| 25 | public function getVisitList($map,$page,$row,$order,$filed = ['*']) | 25 | public function getVisitList($map,$page,$row,$order,$filed = ['*']) |
| 26 | { | 26 | { |
| 27 | - $map['domain'] = $this->user['domain']; | 27 | +// $map['domain'] = $this->user['domain']; |
| 28 | $lists = $this->model->lists($map,$page,$row,$order,$filed); | 28 | $lists = $this->model->lists($map,$page,$row,$order,$filed); |
| 29 | return $this->success($lists); | 29 | return $this->success($lists); |
| 30 | } | 30 | } |
| @@ -33,7 +33,7 @@ class VisitLogic extends BaseLogic | @@ -33,7 +33,7 @@ class VisitLogic extends BaseLogic | ||
| 33 | $this->model = new VisitItem(); | 33 | $this->model = new VisitItem(); |
| 34 | $map = [ | 34 | $map = [ |
| 35 | 'customer_visit_id' => $this->param['id'], | 35 | 'customer_visit_id' => $this->param['id'], |
| 36 | - 'domain' => $this->user['domain'], | 36 | +// 'domain' => $this->user['domain'], |
| 37 | ]; | 37 | ]; |
| 38 | $data = $this->model->list($map); | 38 | $data = $this->model->list($map); |
| 39 | return $this->success($data); | 39 | return $this->success($data); |
app/Models/Inquiry/InquiryOther.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Models\Inquiry; | ||
| 4 | + | ||
| 5 | +use App\Models\Base; | ||
| 6 | +use Illuminate\Database\Eloquent\SoftDeletes; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * Class InquiryOther | ||
| 10 | + * @package App\Models\Inquiry | ||
| 11 | + * @author zbj | ||
| 12 | + * @date 2023/11/29 | ||
| 13 | + */ | ||
| 14 | +class InquiryOther extends Base | ||
| 15 | +{ | ||
| 16 | + use SoftDeletes; | ||
| 17 | + | ||
| 18 | + //连接数据库 | ||
| 19 | + protected $connection = 'custom_mysql'; | ||
| 20 | + | ||
| 21 | + protected $table = 'gl_inquiry_other'; | ||
| 22 | +} |
-
请 注册 或 登录 后发表评论