作者 赵彬吉
@@ -135,7 +135,7 @@ class Count extends Command @@ -135,7 +135,7 @@ class Count extends Command
135 * @time :2023/6/14 15:44 135 * @time :2023/6/14 15:44
136 */ 136 */
137 public function inquiry($arr,$domain,$project_id){ 137 public function inquiry($arr,$domain,$project_id){
138 - $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); 138 + $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain);
139 if($inquiry_list == false){ 139 if($inquiry_list == false){
140 return false; 140 return false;
141 } 141 }
@@ -143,17 +143,9 @@ class Count extends Command @@ -143,17 +143,9 @@ class Count extends Command
143 $arr['inquiry_num'] = 0; 143 $arr['inquiry_num'] = 0;
144 $countryArr = []; 144 $countryArr = [];
145 }else{ 145 }else{
146 - $arr['inquiry_num'] = $inquiry_list['data']['total']; 146 + $arr['inquiry_num'] = $inquiry_list['data']['count'];
147 //询盘国家统计 147 //询盘国家统计
148 - $countryData = $inquiry_list['data']['data'];  
149 - $countryArr = [];  
150 - foreach ($countryData as $v1){  
151 - if(isset($countryArr[$v1['country']])){  
152 - $countryArr[$v1['country']]++;  
153 - }else{  
154 - $countryArr[$v1['country']] = 1;  
155 - }  
156 - } 148 + $countryArr = $inquiry_list['data']['country'];
157 } 149 }
158 //加上其他询盘 150 //加上其他询盘
159 ProjectServer::useProject($project_id); 151 ProjectServer::useProject($project_id);
@@ -102,26 +102,17 @@ class CountAll extends Command @@ -102,26 +102,17 @@ class CountAll extends Command
102 * @time :2023/6/14 15:44 102 * @time :2023/6/14 15:44
103 */ 103 */
104 public function inquiry($arr,$domain,$project_id){ 104 public function inquiry($arr,$domain,$project_id){
105 - $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); 105 + $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain);
106 if($inquiry_list == false){ 106 if($inquiry_list == false){
107 return false; 107 return false;
108 } 108 }
109 - echo date('Y-m-d H:i:s') . '拉取询盘状态:' .$inquiry_list['status'] . PHP_EOL;  
110 if($inquiry_list['status'] == self::STATUS_ERROR){ 109 if($inquiry_list['status'] == self::STATUS_ERROR){
111 $arr['inquiry_num'] = 0; 110 $arr['inquiry_num'] = 0;
112 $countryArr = []; 111 $countryArr = [];
113 }else{ 112 }else{
114 - $arr['inquiry_num'] = $inquiry_list['data']['total']; 113 + $arr['inquiry_num'] = $inquiry_list['data']['count'];
115 //询盘国家统计 114 //询盘国家统计
116 - $countryData = $inquiry_list['data']['data'];  
117 - $countryArr = [];  
118 - foreach ($countryData as $v1){  
119 - if(isset($countryArr[$v1['country']])){  
120 - $countryArr[$v1['country']]++;  
121 - }else{  
122 - $countryArr[$v1['country']] = 1;  
123 - }  
124 - } 115 + $countryArr = $inquiry_list['data']['country'];
125 } 116 }
126 //加上其他询盘 117 //加上其他询盘
127 ProjectServer::useProject($project_id); 118 ProjectServer::useProject($project_id);
@@ -145,25 +145,18 @@ class CountProject extends Command @@ -145,25 +145,18 @@ class CountProject extends Command
145 * @time :2023/6/14 15:44 145 * @time :2023/6/14 15:44
146 */ 146 */
147 public function inquiry($arr,$domain,$project_id){ 147 public function inquiry($arr,$domain,$project_id){
148 - $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); 148 + $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain);
149 if($inquiry_list == false){ 149 if($inquiry_list == false){
150 return false; 150 return false;
151 } 151 }
  152 + echo date('Y-m-d H:i:s') . '拉取询盘状态:' .json_encode($inquiry_list) . PHP_EOL;
152 if($inquiry_list['status'] == self::STATUS_ERROR){ 153 if($inquiry_list['status'] == self::STATUS_ERROR){
153 $arr['inquiry_num'] = 0; 154 $arr['inquiry_num'] = 0;
154 $countryArr = []; 155 $countryArr = [];
155 }else{ 156 }else{
156 - $arr['inquiry_num'] = $inquiry_list['data']['total']; 157 + $arr['inquiry_num'] = $inquiry_list['data']['count'];
157 //询盘国家统计 158 //询盘国家统计
158 - $countryData = $inquiry_list['data']['data'];  
159 - $countryArr = [];  
160 - foreach ($countryData as $v1){  
161 - if(isset($countryArr[$v1['country']])){  
162 - $countryArr[$v1['country']]++;  
163 - }else{  
164 - $countryArr[$v1['country']] = 1;  
165 - }  
166 - } 159 + $countryArr = $inquiry_list['data']['country'];
167 } 160 }
168 //加上其他询盘 161 //加上其他询盘
169 ProjectServer::useProject($project_id); 162 ProjectServer::useProject($project_id);
@@ -85,7 +85,7 @@ class MonthAllCount extends Command @@ -85,7 +85,7 @@ class MonthAllCount extends Command
85 // 获取当月结束时间 85 // 获取当月结束时间
86 $end = date('Y-m-t', strtotime($v['month'])); 86 $end = date('Y-m-t', strtotime($v['month']));
87 $arr['project_id'] = $project_id; 87 $arr['project_id'] = $project_id;
88 - $res = $this->inquiry($url,$v['month']); 88 + $res = (new FormGlobalsoApi())->getMonthInquiry($url,$v['month']);
89 $arr['total'] = $arr['month_total'] = 0; 89 $arr['total'] = $arr['month_total'] = 0;
90 if(isset($res['data']['count'])){ 90 if(isset($res['data']['count'])){
91 echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL; 91 echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
@@ -191,13 +191,4 @@ class MonthAllCount extends Command @@ -191,13 +191,4 @@ class MonthAllCount extends Command
191 return $arr; 191 return $arr;
192 } 192 }
193 193
194 - public function inquiry($url,$month){  
195 - $url = 'https://'.$url.'/';  
196 - $token = md5($url.date("Y-m-d"));  
197 - $url = 'https://form.globalso.com/api/external-interface/country_con/15243d63ed5a5738?domain='.$url.'&token='.$token.'&source=1,2,3,4&model=month&sta_date='.$month;  
198 - $res = http_get($url,['charset=utf-8']);  
199 - echo date('Y-m-d H:i:s') . '数据:'.json_encode($res) . PHP_EOL;  
200 - return $res;  
201 - }  
202 -  
203 } 194 }
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 namespace App\Console\Commands\MonthlyCount; 10 namespace App\Console\Commands\MonthlyCount;
11 11
  12 +use App\Helper\FormGlobalsoApi;
12 use App\Models\Com\UpdateOldInfo; 13 use App\Models\Com\UpdateOldInfo;
13 use App\Models\Domain\DomainInfo; 14 use App\Models\Domain\DomainInfo;
14 use App\Models\Inquiry\InquiryFormData; 15 use App\Models\Inquiry\InquiryFormData;
@@ -108,7 +109,7 @@ class MonthCount extends Command @@ -108,7 +109,7 @@ class MonthCount extends Command
108 // 获取当月结束时间 109 // 获取当月结束时间
109 $end = date('Y-m-t', strtotime($v['month'])); 110 $end = date('Y-m-t', strtotime($v['month']));
110 $arr['project_id'] = $project_id; 111 $arr['project_id'] = $project_id;
111 - $res = $this->inquiry($url,$v['month']); 112 + $res = (new FormGlobalsoApi())->getMonthInquiry($url,$v['month']);
112 $arr['total'] = $arr['month_total'] = 0; 113 $arr['total'] = $arr['month_total'] = 0;
113 if(isset($res['data']['count'])){ 114 if(isset($res['data']['count'])){
114 echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL; 115 echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
@@ -212,13 +213,4 @@ class MonthCount extends Command @@ -212,13 +213,4 @@ class MonthCount extends Command
212 return $arr; 213 return $arr;
213 } 214 }
214 215
215 - public function inquiry($url,$month){  
216 - $url = 'https://'.$url.'/';  
217 - $token = md5($url.date("Y-m-d"));  
218 - $url = 'https://form.globalso.com/api/external-interface/country_con/15243d63ed5a5738?domain='.$url.'&token='.$token.'&source=1,2,3,4&model=month&sta_date='.$month;  
219 - $res = http_get($url,['charset=utf-8']);  
220 - echo date('Y-m-d H:i:s') . '数据:'.json_encode($res) . PHP_EOL;  
221 - return $res;  
222 - }  
223 -  
224 } 216 }
@@ -80,11 +80,10 @@ class MonthProjectCount extends Command @@ -80,11 +80,10 @@ class MonthProjectCount extends Command
80 // 获取当月结束时间 80 // 获取当月结束时间
81 $end = date('Y-m-t', strtotime($v)); 81 $end = date('Y-m-t', strtotime($v));
82 $arr['project_id'] = $project_id; 82 $arr['project_id'] = $project_id;
83 - $res = $this->inquiry($url,$v); 83 + $res = (new FormGlobalsoApi())->getMonthInquiry($url,$v);
84 echo date('Y-m-d H:i:s') . '月份:'.$v. PHP_EOL; 84 echo date('Y-m-d H:i:s') . '月份:'.$v. PHP_EOL;
85 $arr['total'] = $arr['month_total'] = 0; 85 $arr['total'] = $arr['month_total'] = 0;
86 if(isset($res['data']['count'])){ 86 if(isset($res['data']['count'])){
87 - echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;  
88 $arr['month_total'] = $res['data']['count'] + InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); 87 $arr['month_total'] = $res['data']['count'] + InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']);
89 } 88 }
90 //获取上一个的count 89 //获取上一个的count
@@ -95,7 +94,6 @@ class MonthProjectCount extends Command @@ -95,7 +94,6 @@ class MonthProjectCount extends Command
95 }else{ 94 }else{
96 $arr['total'] = $arr['month_total'] + ($previousInfo['total'] ?? 0); 95 $arr['total'] = $arr['month_total'] + ($previousInfo['total'] ?? 0);
97 } 96 }
98 - echo date('Y-m-d H:i:s') . '加上其他询盘:'.$arr['total'] . PHP_EOL;  
99 $country = []; 97 $country = [];
100 if(isset($res['data']['data'])){ 98 if(isset($res['data']['data'])){
101 $country = $res['data']['data']; 99 $country = $res['data']['data'];
@@ -117,7 +115,6 @@ class MonthProjectCount extends Command @@ -117,7 +115,6 @@ class MonthProjectCount extends Command
117 $firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month")); 115 $firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month"));
118 $arr['created_at'] = $firstDayOfNextMonth; 116 $arr['created_at'] = $firstDayOfNextMonth;
119 $arr['updated_at'] = $firstDayOfNextMonth; 117 $arr['updated_at'] = $firstDayOfNextMonth;
120 -// echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL;  
121 $monthCountModel->insert($arr); 118 $monthCountModel->insert($arr);
122 }else{ 119 }else{
123 $monthCountModel->edit($arr,['id'=>$info['id']]); 120 $monthCountModel->edit($arr,['id'=>$info['id']]);
@@ -188,15 +185,6 @@ class MonthProjectCount extends Command @@ -188,15 +185,6 @@ class MonthProjectCount extends Command
188 return $arr; 185 return $arr;
189 } 186 }
190 187
191 - public function inquiry($url,$month){  
192 - $url = 'https://'.$url.'/';  
193 - $token = md5($url.date("Y-m-d"));  
194 - $url = 'https://form.globalso.com/api/external-interface/country_con/15243d63ed5a5738?domain='.$url.'&token='.$token.'&source=1,2,3,4&model=month&sta_date='.$month;  
195 - $res = http_get($url,['charset=utf-8']);  
196 - echo date('Y-m-d H:i:s') . '数据:'.json_encode($res) . PHP_EOL;  
197 - return $res;  
198 - }  
199 -  
200 /** 188 /**
201 * @remark :补齐月份 189 * @remark :补齐月份
202 * @name :fillMissingMonths 190 * @name :fillMissingMonths
@@ -35,6 +35,7 @@ use App\Models\Template\BTemplateCom; @@ -35,6 +35,7 @@ use App\Models\Template\BTemplateCom;
35 use App\Services\AmazonS3Service; 35 use App\Services\AmazonS3Service;
36 use App\Services\ProjectServer; 36 use App\Services\ProjectServer;
37 use App\Utils\EncryptUtils; 37 use App\Utils\EncryptUtils;
  38 +use GuzzleHttp\Exception\GuzzleException;
38 use Illuminate\Console\Command; 39 use Illuminate\Console\Command;
39 use Illuminate\Support\Facades\DB; 40 use Illuminate\Support\Facades\DB;
40 use Illuminate\Support\Facades\Schema; 41 use Illuminate\Support\Facades\Schema;
@@ -56,6 +57,21 @@ class Demo extends Command @@ -56,6 +57,21 @@ class Demo extends Command
56 */ 57 */
57 protected $description = 'demo'; 58 protected $description = 'demo';
58 59
  60 + public function handle(){
  61 + $domain = "https://www.xawellauto.com/";
  62 + $token = md5($domain.date("Y-m-d"));
  63 + $url = "https://form.globalso.com/api/external-interface/domain_con/15243d63ed5a5738?domain=$domain&token=$token&source=1,2,3,4&num=15";
  64 + $url = $url."&sta_date=2024-07";
  65 + try {
  66 + $res = http_get($url,['charset=utf-8']);
  67 + } catch (\Exception | GuzzleException $e) {
  68 + errorLog('提交询盘信息失败', $domain, $e);
  69 + return false;
  70 + }
  71 + echo date('Y-m-d H:i:s') . '数据:'.json_encode($res) . PHP_EOL;
  72 + return $res;
  73 + }
  74 +
59 // public function handle(){ 75 // public function handle(){
60 // $projectModel = new Project(); 76 // $projectModel = new Project();
61 // $list = $projectModel->list(['id'=>503]); 77 // $list = $projectModel->list(['id'=>503]);
@@ -89,26 +105,26 @@ class Demo extends Command @@ -89,26 +105,26 @@ class Demo extends Command
89 // DB::disconnect('custom_mysql'); 105 // DB::disconnect('custom_mysql');
90 // } 106 // }
91 // } 107 // }
92 - public function handle(){  
93 - ProjectServer::useProject(503);  
94 - $newsCate = new NewsCategory();  
95 - $newsList = $newsCate->list();  
96 - foreach ($newsList as $v){  
97 - $data = [  
98 - 'name'=>$v['name'],  
99 - 'status'=>0,  
100 - 'sort'=>$v['sort'],  
101 - 'pid'=>$v['pid'],  
102 - 'route'=>$v['alias'],  
103 - 'project_id'=>503,  
104 - 'operator_id'=>$v['operator_id'],  
105 - 'create_id'=>1101,  
106 - 'module_id'=>10,  
107 - ];  
108 - $moduleCateModel = new CustomModuleCategory();  
109 - $id = $moduleCateModel->addReturnId($data);  
110 - RouteMap::setRoute($v['alias'],RouteMap::SOURCE_MODULE_CATE,$id,503);  
111 - }  
112 - DB::disconnect('custom_mysql');  
113 - } 108 +// public function handle(){
  109 +// ProjectServer::useProject(503);
  110 +// $newsCate = new NewsCategory();
  111 +// $newsList = $newsCate->list();
  112 +// foreach ($newsList as $v){
  113 +// $data = [
  114 +// 'name'=>$v['name'],
  115 +// 'status'=>0,
  116 +// 'sort'=>$v['sort'],
  117 +// 'pid'=>$v['pid'],
  118 +// 'route'=>$v['alias'],
  119 +// 'project_id'=>503,
  120 +// 'operator_id'=>$v['operator_id'],
  121 +// 'create_id'=>1101,
  122 +// 'module_id'=>10,
  123 +// ];
  124 +// $moduleCateModel = new CustomModuleCategory();
  125 +// $id = $moduleCateModel->addReturnId($data);
  126 +// RouteMap::setRoute($v['alias'],RouteMap::SOURCE_MODULE_CATE,$id,503);
  127 +// }
  128 +// DB::disconnect('custom_mysql');
  129 +// }
114 } 130 }
@@ -150,24 +150,15 @@ class Test extends Command @@ -150,24 +150,15 @@ class Test extends Command
150 } 150 }
151 151
152 public function inquiry($arr,$domain,$project_id){ 152 public function inquiry($arr,$domain,$project_id){
153 - $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); 153 + $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain);
154 if($inquiry_list['status'] == 400){ 154 if($inquiry_list['status'] == 400){
155 $arr['inquiry_num'] = 0; 155 $arr['inquiry_num'] = 0;
156 $countryArr = []; 156 $countryArr = [];
157 }else{ 157 }else{
158 - $arr['inquiry_num'] = $inquiry_list['data']['total']; 158 + $arr['inquiry_num'] = $inquiry_list['data']['count'];
159 //询盘国家统计 159 //询盘国家统计
160 - $countryData = $inquiry_list['data']['data'];  
161 - $countryArr = [];  
162 - foreach ($countryData as $v1){  
163 - if(isset($countryArr[$v1['country']])){  
164 - $countryArr[$v1['country']]++;  
165 - }else{  
166 - $countryArr[$v1['country']] = 1;  
167 - }  
168 - } 160 + $countryArr = $inquiry_list['data']['country'];
169 } 161 }
170 -  
171 //加上其他询盘 162 //加上其他询盘
172 $arr['inquiry_num'] += InquiryFormData::getCount(); 163 $arr['inquiry_num'] += InquiryFormData::getCount();
173 $countryData = InquiryFormData::getCountryCount(); 164 $countryData = InquiryFormData::getCountryCount();
@@ -155,5 +155,41 @@ class FormGlobalsoApi @@ -155,5 +155,41 @@ class FormGlobalsoApi
155 return $res; 155 return $res;
156 } 156 }
157 157
  158 + /**
  159 + * @remark :获取当前项目所有询盘及询盘国家
  160 + * @name :getInquiryAll
  161 + * @author :lyh
  162 + * @method :post
  163 + * @time :2024/8/15 14:16
  164 + */
  165 + public function getInquiryAll($domain){
  166 + if (!(strpos($domain, 'https://') === 0)) {
  167 + $domain = 'https://'.$domain.'/';
  168 + }
  169 + $token = md5($domain.date("Y-m-d"));
  170 + $url = "https://form.globalso.com/api/external-interface/domain_con/15243d63ed5a5738?domain=$domain&token=$token&source=1,2,3,4&num=15";
  171 + try {
  172 + $res = http_get($url,['charset=utf-8']);
  173 + } catch (\Exception | GuzzleException $e) {
  174 + errorLog('提交询盘信息失败', $domain, $e);
  175 + return false;
  176 + }
  177 + return $res;
  178 + }
158 179
  180 + /**
  181 + * @remark :按月份统计询盘
  182 + * @name :inquiry
  183 + * @author :lyh
  184 + * @method :post
  185 + * @time :2024/8/16 10:16
  186 + */
  187 + public function getMonthInquiry($url,$month){
  188 + $url = 'https://'.$url.'/';
  189 + $token = md5($url.date("Y-m-d"));
  190 + $url = 'https://form.globalso.com/api/external-interface/country_con/15243d63ed5a5738?domain='.$url.'&token='.$token.'&source=1,2,3,4&model=month&sta_date='.$month;
  191 + $res = http_get($url,['charset=utf-8']);
  192 + echo date('Y-m-d H:i:s') . '数据:'.json_encode($res) . PHP_EOL;
  193 + return $res;
  194 + }
159 } 195 }
@@ -927,3 +927,5 @@ function base62_encode($num) { @@ -927,3 +927,5 @@ function base62_encode($num) {
927 } 927 }
928 928
929 929
  930 +
  931 +
@@ -14,6 +14,7 @@ use App\Helper\Arr; @@ -14,6 +14,7 @@ use App\Helper\Arr;
14 use App\Helper\FormGlobalsoApi; 14 use App\Helper\FormGlobalsoApi;
15 use App\Models\Domain\DomainInfo; 15 use App\Models\Domain\DomainInfo;
16 use App\Models\HomeCount\Count; 16 use App\Models\HomeCount\Count;
  17 +use App\Models\HomeCount\MonthCount;
17 use App\Models\Inquiry\InquiryFormData; 18 use App\Models\Inquiry\InquiryFormData;
18 use App\Models\Project\Project; 19 use App\Models\Project\Project;
19 use App\Models\RankData\ExternalLinks; 20 use App\Models\RankData\ExternalLinks;
@@ -115,7 +116,7 @@ class OptimizationReportController extends BaseController @@ -115,7 +116,7 @@ class OptimizationReportController extends BaseController
115 // 获取当前月的结束时间 116 // 获取当前月的结束时间
116 $endTime = date('Y-m-t', strtotime($this->param['date'])); 117 $endTime = date('Y-m-t', strtotime($this->param['date']));
117 $arr = []; 118 $arr = [];
118 - $arr = $this->inquiryCount($arr,$startTime,$endTime,$domain); 119 + $arr = $this->inquiryCount($arr,$startTime,$endTime,$domain,$project_id);
119 $arr = $this->flowCount($arr,$startTime,$endTime,$project_id); 120 $arr = $this->flowCount($arr,$startTime,$endTime,$project_id);
120 $arr = $this->sourceCount($arr,$startTime,$endTime,$domain); 121 $arr = $this->sourceCount($arr,$startTime,$endTime,$domain);
121 $arr['month'] = date('Y-m',time()); 122 $arr['month'] = date('Y-m',time());
@@ -131,42 +132,15 @@ class OptimizationReportController extends BaseController @@ -131,42 +132,15 @@ class OptimizationReportController extends BaseController
131 * @method :post 132 * @method :post
132 * @time :2023/6/30 14:29 133 * @time :2023/6/30 14:29
133 */ 134 */
134 - public function inquiryCount(&$arr,&$startTime,&$endTime,$domain){  
135 - $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);  
136 - if(!empty($inquiry_list)){  
137 - //总数  
138 - $arr['total'] = $inquiry_list['data']['total'] ?? 0;  
139 - //数据详情  
140 - $data = $inquiry_list['data']['data'] ?? '';  
141 - $arr['month_total'] = 0;  
142 - $countryArr = [];  
143 - if(isset($data) && !empty($data)){  
144 - foreach ($data as $v){  
145 - if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){  
146 - $arr['month_total']++;  
147 - if(isset($countryArr[$v['country']])){  
148 - $countryArr[$v['country']]++;  
149 - }else{  
150 - $countryArr[$v['country']] = 1;  
151 - }  
152 - }  
153 - }  
154 - }  
155 - }  
156 - //加上其他询盘  
157 - $arr['total'] += InquiryFormData::getCount();  
158 - $arr['month_total'] += InquiryFormData::getCount([$startTime, $endTime]);  
159 - $countryData = InquiryFormData::getCountryCount([$startTime, $endTime]);  
160 - foreach ($countryData as $v1){  
161 - if(isset($countryArr[$v1['country']])){  
162 - $countryArr[$v1['country']] += $v1['count'];  
163 - }else{  
164 - $countryArr[$v1['country']] = $v1['count'];  
165 - } 135 + public function inquiryCount(&$arr, &$startTime, $project_id){
  136 + $month = date('Y-m',strtotime($startTime));
  137 + $monthCountModel = new MonthCount();
  138 + $info = $monthCountModel->read(['project_id'=>$project_id,'month'=>$month]);
  139 + if($info !== false){
  140 + $arr['country'] = $info['country'];
  141 + $arr['total'] = $info['total'];
  142 + $arr['month_total'] = $info['month_total'];
166 } 143 }
167 - arsort($countryArr);  
168 - $top20 = array_slice($countryArr, 0, 15, true);  
169 - $arr['country'] = $top20;  
170 return $arr; 144 return $arr;
171 } 145 }
172 146
@@ -350,9 +324,9 @@ class OptimizationReportController extends BaseController @@ -350,9 +324,9 @@ class OptimizationReportController extends BaseController
350 public function pv_ip($domain){ 324 public function pv_ip($domain){
351 $pv = (new VisitItem())->count(); 325 $pv = (new VisitItem())->count();
352 $ip = (new Visit())->count(); 326 $ip = (new Visit())->count();
353 - $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); 327 + $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain);
354 if(!empty($inquiry_list)){ 328 if(!empty($inquiry_list)){
355 - $total = $inquiry_list['data']['total'] ?? 0; 329 + $total = $inquiry_list['data']['count'] ?? 0;
356 } 330 }
357 return [ 331 return [
358 'total_pv'=>$pv, 332 'total_pv'=>$pv,
@@ -65,6 +65,7 @@ class CNoticeController extends BaseController @@ -65,6 +65,7 @@ class CNoticeController extends BaseController
65 if($domain_info){ 65 if($domain_info){
66 //判断是否已有更新进行中 66 //判断是否已有更新进行中
67 $notify_model = new Notify(); 67 $notify_model = new Notify();
  68 + $type = $is_sitemap == 1 ? Notify::TYPE_ALL_SITEMAP : $type;
68 $data = [ 69 $data = [
69 'project_id' => $project_id, 70 'project_id' => $project_id,
70 'type' => $type, 71 'type' => $type,
@@ -90,6 +91,7 @@ class CNoticeController extends BaseController @@ -90,6 +91,7 @@ class CNoticeController extends BaseController
90 91
91 $data['data'] = Arr::a2s(['domain'=>$domain,'url'=>$url,'language'=>$language]); 92 $data['data'] = Arr::a2s(['domain'=>$domain,'url'=>$url,'language'=>$language]);
92 $data['status'] = $is_sitemap == 1 ? Notify::STATUS_FINISH_PAGE : Notify::STATUS_INIT; 93 $data['status'] = $is_sitemap == 1 ? Notify::STATUS_FINISH_PAGE : Notify::STATUS_INIT;
  94 + $data['is_pull_html_zip'] = $is_sitemap == 1 ? Notify::IS_PULL_HTML_ZIP_TRUE : Notify::IS_PULL_HTML_ZIP_FALSE;
93 $notify_model->add($data); 95 $notify_model->add($data);
94 } 96 }
95 } 97 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :InquiryFieldController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/8/13 10:45
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Bside\Inquiry;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Bside\BaseController;
  14 +use App\Models\Inquiry\InquiryField;
  15 +
  16 +/**
  17 + * @remark :詢盤字段映射
  18 + * @name :InquiryFieldController
  19 + * @author :lyh
  20 + * @method :post
  21 + * @time :2024/8/13 10:45
  22 + */
  23 +class InquiryFieldController extends BaseController
  24 +{
  25 + /**
  26 + * @remark :詢盤字段映射
  27 + * @name :lists
  28 + * @author :lyh
  29 + * @method :post
  30 + * @time :2024/8/13 10:59
  31 + */
  32 + public function lists(){
  33 + $inquiryModel = new InquiryField();
  34 + $lists = $inquiryModel->list($this->map);
  35 + $this->response('success',Code::SUCCESS,$lists);
  36 + }
  37 +
  38 + /**
  39 + * @remark :保存數據
  40 + * @name :save
  41 + * @author :lyh
  42 + * @method :post
  43 + * @time :2024/8/13 11:13
  44 + */
  45 + public function save(){
  46 + $this->request->validate([
  47 + 'data'=>'required',
  48 + ],[
  49 + 'data.required' => 'data不能为空',
  50 + ]);
  51 + $inquiryModel = new InquiryField();
  52 + foreach ($this->param['data'] as $v){
  53 + if(isset($v['id']) && !empty($v['id'])){
  54 + $inquiryModel->edit(['en_name'=>$v['en_name']],['id'=>$v['id']]);
  55 + }else{
  56 + $inquiryModel->addReturnId(['name'=>$v['name'], 'en_name'=>$v['en_name']]);
  57 + }
  58 + }
  59 + $this->response('success');
  60 + }
  61 +
  62 + /**
  63 + * @remark :刪除數據
  64 + * @name :del
  65 + * @author :lyh
  66 + * @method :post
  67 + * @time :2024/8/13 11:14
  68 + */
  69 + public function del(){
  70 +
  71 + $this->request->validate([
  72 + 'id'=>'required',
  73 + ],[
  74 + 'id.required' => 'name不能为空',
  75 + ]);
  76 + $inquiryModel = new InquiryField();
  77 + $inquiryModel->del(['id'=>['in',$this->param['id']]]);
  78 + $this->response('success');
  79 + }
  80 +}
@@ -254,6 +254,7 @@ class LoginController extends BaseController @@ -254,6 +254,7 @@ class LoginController extends BaseController
254 } 254 }
255 //没有from_order_id的项目 进入演示版 运营中心 255 //没有from_order_id的项目 进入演示版 运营中心
256 $arr['from_order_id'] = $arr['from_order_id'] ?? 0; 256 $arr['from_order_id'] = $arr['from_order_id'] ?? 0;
  257 + $arr['phone'] = $arr['phone'] ?? '';
257 if(!$arr['from_order_id']){ 258 if(!$arr['from_order_id']){
258 //有账号就直接登录, 没有账号创建账号登录 259 //有账号就直接登录, 没有账号创建账号登录
259 $user = (new User())->where('project_id', Project::DEMO_PROJECT_ID)->where('mobile', $arr['phone'])->first(); 260 $user = (new User())->where('project_id', Project::DEMO_PROJECT_ID)->where('mobile', $arr['phone'])->first();
@@ -277,16 +278,25 @@ class LoginController extends BaseController @@ -277,16 +278,25 @@ class LoginController extends BaseController
277 'manager_id'=>0, 278 'manager_id'=>0,
278 ]; 279 ];
279 }else{ 280 }else{
280 - //有from_order_id, 找到对应的项目并登录账号 281 + //有from_order_id, 找到对应的项目并登录对应账号
281 $project = (new Project())->read(['from_order_id'=>$arr['from_order_id'], 'delete_status' => Project::IS_DEL_FALSE]); 282 $project = (new Project())->read(['from_order_id'=>$arr['from_order_id'], 'delete_status' => Project::IS_DEL_FALSE]);
282 if(!$project){ 283 if(!$project){
283 $this->response('项目不存在,请联系管理员',Code::USER_ERROR); 284 $this->response('项目不存在,请联系管理员',Code::USER_ERROR);
284 } 285 }
285 - $data = [  
286 - 'project_id'=>$project['id'],  
287 - 'manager_id'=>0,  
288 - ]; 286 + $user = (new User())->where('project_id', $project['id'])->where('mobile', $arr['phone'])->first();
  287 + if(!$user){
  288 + $data = [
  289 + 'project_id'=>$project['id'],
  290 + 'manager_id'=>0,
  291 + ];
  292 + }else{
  293 + $data = [
  294 + 'user_id'=>$user['id'],
  295 + 'manager_id'=>0,
  296 + ];
  297 + }
289 } 298 }
  299 +
290 $info = $logic->autologin($data); 300 $info = $logic->autologin($data);
291 $this->response('success',Code::SUCCESS,['info'=>$info]); 301 $this->response('success',Code::SUCCESS,['info'=>$info]);
292 } 302 }
@@ -174,7 +174,7 @@ class ProductController extends BaseController @@ -174,7 +174,7 @@ class ProductController extends BaseController
174 $this->param['featured_status'] = $this->param['featured_status'] ?? 0; 174 $this->param['featured_status'] = $this->param['featured_status'] ?? 0;
175 if($this->param['featured_status'] != Category::STATUS_ACTIVE) { 175 if($this->param['featured_status'] != Category::STATUS_ACTIVE) {
176 $cateModel = new Category(); 176 $cateModel = new Category();
177 - $featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray(); 177 + $featured_ids = $cateModel->formatQuery(['title'=>['in',['Featured','featured']]])->pluck('id')->toArray();
178 if(!empty($featured_ids)){ 178 if(!empty($featured_ids)){
179 $status = []; 179 $status = [];
180 if(isset($this->map['status'])){ 180 if(isset($this->map['status'])){
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 9
10 namespace App\Http\Logic\Aside\ExtensionModule; 10 namespace App\Http\Logic\Aside\ExtensionModule;
11 11
12 -use App\Http\Logic\Bside\BaseLogic; 12 +use App\Http\Logic\Aside\BaseLogic;
13 use App\Models\ExtentModule\ExtensionModule; 13 use App\Models\ExtentModule\ExtensionModule;
14 use App\Models\ExtentModule\ExtensionModuleField; 14 use App\Models\ExtentModule\ExtensionModuleField;
15 use App\Services\ProjectServer; 15 use App\Services\ProjectServer;
@@ -43,7 +43,8 @@ class ExtensionModuleLogic extends BaseLogic @@ -43,7 +43,8 @@ class ExtensionModuleLogic extends BaseLogic
43 if($info !== false){ 43 if($info !== false){
44 $this->fail('当前拓展数据名称已存在'); 44 $this->fail('当前拓展数据名称已存在');
45 } 45 }
46 - $this->param['data'] = empty($this->param['data']) ? null : json_encode($this->param['data']); 46 + $this->param['operator_id'] = $this->manager['id'];
  47 + $this->param['data'] = json_encode($this->param['data'] ?? []);
47 if(isset($this->param['id']) && !empty($this->param['id'])){ 48 if(isset($this->param['id']) && !empty($this->param['id'])){
48 $id = $this->param['id']; 49 $id = $this->param['id'];
49 $this->model->edit($this->param,['id'=>$id]); 50 $this->model->edit($this->param,['id'=>$id]);
@@ -905,7 +905,7 @@ class ProductLogic extends BaseLogic @@ -905,7 +905,7 @@ class ProductLogic extends BaseLogic
905 $this->param['deleted_at'] = null; 905 $this->param['deleted_at'] = null;
906 $this->param['featured_status'] = $this->param['featured_status'] ?? 0; 906 $this->param['featured_status'] = $this->param['featured_status'] ?? 0;
907 if(($this->param['featured_status'] != Category::STATUS_ACTIVE)) { 907 if(($this->param['featured_status'] != Category::STATUS_ACTIVE)) {
908 - $this->param['title'] = ['not like','Featured%']; 908 + $this->param['title'] = ['in',['Featured','featured']];
909 } 909 }
910 unset($this->param['featured_status']); 910 unset($this->param['featured_status']);
911 $list = $categoryModel->list($this->param, ['sort', 'id'], ['id', 'pid', 'title']); 911 $list = $categoryModel->list($this->param, ['sort', 'id'], ['id', 'pid', 'title']);
@@ -38,6 +38,9 @@ class TranslateLogic extends BaseLogic @@ -38,6 +38,9 @@ class TranslateLogic extends BaseLogic
38 public function getTranslateList(){ 38 public function getTranslateList(){
39 $data = []; 39 $data = [];
40 if($this->param['url'] == 'All' || $this->param['url'] == 'other_all_text'){ 40 if($this->param['url'] == 'All' || $this->param['url'] == 'other_all_text'){
  41 + if($this->param['url'] == 'other_all_text'){
  42 + $this->param['language_id'] = 0;
  43 + }
41 $info = $this->model->with('translate_data')->where(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']])->first(); 44 $info = $this->model->with('translate_data')->where(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']])->first();
42 if(!empty($info) && !empty($info['translate_data'])){ 45 if(!empty($info) && !empty($info['translate_data'])){
43 $translateInfo = json_decode($info['translate_data']['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); 46 $translateInfo = json_decode($info['translate_data']['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
@@ -271,6 +274,9 @@ class TranslateLogic extends BaseLogic @@ -271,6 +274,9 @@ class TranslateLogic extends BaseLogic
271 } 274 }
272 //解析路由 275 //解析路由
273 $sendData = $this->handleRoute($this->param['url']); 276 $sendData = $this->handleRoute($this->param['url']);
  277 + if($this->param['url'] == 'other_all_text'){
  278 + $this->param['language_id'] = 0;
  279 + }
274 DB::beginTransaction(); 280 DB::beginTransaction();
275 try { 281 try {
276 $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]); 282 $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
@@ -18,11 +18,12 @@ class Notify extends Base @@ -18,11 +18,12 @@ class Notify extends Base
18 const STATUS_ERROR = 9; 18 const STATUS_ERROR = 9;
19 19
20 /** 20 /**
21 - * 类型 1:主站, 2:小语种, 3:amp 21 + * 类型 1:主站, 2:小语种, 3:amp,4:sitemap
22 */ 22 */
23 const TYPE_MASTER = 1; 23 const TYPE_MASTER = 1;
24 const TYPE_MINOR = 2; 24 const TYPE_MINOR = 2;
25 const TYPE_AMP = 3; 25 const TYPE_AMP = 3;
  26 + const TYPE_ALL_SITEMAP = 4;
26 27
27 /** 28 /**
28 * 路由 29 * 路由
@@ -41,6 +42,14 @@ class Notify extends Base @@ -41,6 +42,14 @@ class Notify extends Base
41 const ROUTE_PRODUCT_VIDEO_KEYWORD = 6; 42 const ROUTE_PRODUCT_VIDEO_KEYWORD = 6;
42 43
43 /** 44 /**
  45 + * 是否拉取HTML压缩包
  46 + * 0:默认不拉取
  47 + * 1:拉取
  48 + */
  49 + const IS_PULL_HTML_ZIP_FALSE = 0;
  50 + const IS_PULL_HTML_ZIP_TRUE = 1;
  51 +
  52 + /**
44 * 类型 53 * 类型
45 * @return array 54 * @return array
46 */ 55 */
@@ -578,6 +578,13 @@ Route::middleware(['bloginauth'])->group(function () { @@ -578,6 +578,13 @@ Route::middleware(['bloginauth'])->group(function () {
578 Route::any('/addModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'addModuleValue'])->name('extension_module_addModuleValue'); 578 Route::any('/addModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'addModuleValue'])->name('extension_module_addModuleValue');
579 Route::any('/editModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'editModuleValue'])->name('extension_module_editModuleValue'); 579 Route::any('/editModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'editModuleValue'])->name('extension_module_editModuleValue');
580 }); 580 });
  581 +
  582 + //自定义小语种文本信息
  583 + Route::prefix('inquiry_field')->group(function () {
  584 + Route::any('/', [\App\Http\Controllers\Bside\Inquiry\InquiryFieldController::class, 'lists'])->name('inquiry_field_lists');
  585 + Route::any('/save', [\App\Http\Controllers\Bside\Inquiry\InquiryFieldController::class, 'save'])->name('inquiry_field_save');
  586 + Route::any('/del', [\App\Http\Controllers\Bside\Inquiry\InquiryFieldController::class, 'del'])->name('inquiry_field_del');
  587 + });
581 }); 588 });
582 //无需登录验证的路由组 589 //无需登录验证的路由组
583 Route::group([], function () { 590 Route::group([], function () {