|
@@ -185,174 +185,27 @@ class DownloadProject extends Command |
|
@@ -185,174 +185,27 @@ class DownloadProject extends Command |
|
185
|
return ['file_link'=>url('upload/excel/'.$filename)];
|
185
|
return ['file_link'=>url('upload/excel/'.$filename)];
|
|
186
|
}
|
186
|
}
|
|
187
|
|
187
|
|
|
188
|
-// public function downloadItem($filed = ['id','depth','created_at','referrer_url','url','device_port','country','ip']){
|
|
|
|
189
|
-// $visitModel = new Visit();
|
|
|
|
190
|
-// $page = 1;
|
|
|
|
191
|
-// $pageSize = 3000;
|
|
|
|
192
|
-// $lists = $visitModel->lists(['updated_date'=>['between',['2025-02-01','2025-02-31']]],$page,$pageSize,'id',$filed);
|
|
|
|
193
|
-// foreach ($lists as $v){
|
|
|
|
194
|
-// $customer_visit_id[] = $v['id'];
|
|
|
|
195
|
-// }
|
|
|
|
196
|
-// $itemModel = new VisitItem();
|
|
|
|
197
|
-// $itemList = $itemModel->list(['customer_visit_id'=>['in',$customer_visit_id]],['customer_visit_id','url']);
|
|
|
|
198
|
-// foreach ($lists as $key => $value){
|
|
|
|
199
|
-// $sub = [];
|
|
|
|
200
|
-// foreach ($itemList as $sonValue){
|
|
|
|
201
|
-// if($value['id'] == $sonValue['customer_visit_id']){
|
|
|
|
202
|
-// $sub[] = $sonValue;
|
|
|
|
203
|
-// }
|
|
|
|
204
|
-// }
|
|
|
|
205
|
-// $value['sub'] = $sub;
|
|
|
|
206
|
-// $lists[$key] = $value;
|
|
|
|
207
|
-// }
|
|
|
|
208
|
-// return $lists;
|
|
|
|
209
|
-// }
|
|
|
|
210
|
-
|
|
|
|
211
|
- public function workChatMessage($data,$project_id){
|
|
|
|
212
|
- $data['main_lang_id'] = 8;
|
|
|
|
213
|
- $arr = [];
|
|
|
|
214
|
- $content = '';
|
|
|
|
215
|
- $content1 = '';
|
|
|
|
216
|
- if(!empty($data['inquiry_total'])){
|
|
|
|
217
|
- $content1 .= '项目共计已收到询盘 '.$data['inquiry_total'].'条,';
|
|
|
|
218
|
- if(!empty($data['week_inquiry_total'])){
|
|
|
|
219
|
- $content1 .= '本周新收 '.$data['week_inquiry_total'].' 封询盘。';
|
|
|
|
220
|
- }
|
|
|
|
221
|
- if(!empty($data['inquiry_country'])){
|
|
|
|
222
|
- $data['inquiry_country'] = json_decode($data['inquiry_country'],true);
|
|
|
|
223
|
- arsort($data['inquiry_country']);
|
|
|
|
224
|
- $data['inquiry_country'] = array_slice($data['inquiry_country'], 0, 4, true);
|
|
|
|
225
|
- $country = '';
|
|
|
|
226
|
- foreach ($data['inquiry_country'] as $k => $v){
|
|
|
|
227
|
- $country .= $k.',';
|
|
|
|
228
|
- };
|
|
|
|
229
|
- $country = trim($country,',');
|
|
|
|
230
|
- if(!empty($country)){
|
|
|
|
231
|
- $content1 .= '询盘主要来源于'.$country.'等国家地区';
|
|
|
|
232
|
- }
|
|
|
|
233
|
- }
|
|
|
|
234
|
- $content1 .= '如有高质量客户,请您密切关注与跟进;';
|
|
|
|
235
|
- }
|
|
|
|
236
|
- if(!empty($content1)){
|
|
|
|
237
|
- $arr[] = $content1;
|
|
|
|
238
|
- }
|
|
|
|
239
|
- $content2 = '';
|
|
|
|
240
|
- if(!empty($data['google_indexed_num']) || !empty($data['google_links_num']) || !empty($data['keyword_home_num']) || !empty($data['keyword_three_num']) || !empty($data['keyword_five_num']) || !empty($data['keyword_ten_num']) || !empty($data['daily_average_num'])){
|
|
|
|
241
|
- $content2 .= '项目截止目前';
|
|
|
|
242
|
- if($data['main_lang_id'] == 8){
|
|
|
|
243
|
- $title = 'Yandex';
|
|
|
|
244
|
- }else{
|
|
|
|
245
|
- $title = '谷歌';
|
|
|
|
246
|
- }
|
|
|
|
247
|
- if(!empty($data['google_indexed_num'])){
|
|
|
|
248
|
- $content2 .= $title.'收录量:'.$data['google_indexed_num'].'条,';
|
|
|
|
249
|
- }
|
|
|
|
250
|
- if(!empty($data['google_links_num'])){
|
|
|
|
251
|
- //获取上一次的外链数
|
|
|
|
252
|
- $latestRecord = V6WeeklyReport::where(['project_id'=>$project_id])->orderBy('id', 'desc')->first();
|
|
|
|
253
|
- if(!empty($latestRecord)){
|
|
|
|
254
|
- if($latestRecord['google_links_num'] != $data['google_links_num']){
|
|
|
|
255
|
- $content2 .= '外链量:'.$data['google_links_num'].'条,';
|
|
|
|
256
|
- }
|
|
|
|
257
|
- }else{
|
|
|
|
258
|
- $content2 .= '外链量:'.$data['google_links_num'].'条,';
|
|
|
|
259
|
- }
|
|
|
|
260
|
- }
|
|
|
|
261
|
- if(!empty($data['keyword_home_num']) || !empty($data['keyword_three_num']) || !empty($data['keyword_five_num']) || !empty($data['keyword_ten_num'])){
|
|
|
|
262
|
- $content2 .= $title.'搜索排名';
|
|
|
|
263
|
- if(!empty($data['keyword_home_num'])){
|
|
|
|
264
|
- $content2 .= '首页关键词数量为:'.$data['keyword_home_num'].'个,';
|
|
|
|
265
|
- }
|
|
|
|
266
|
- if(!empty($data['keyword_three_num'])){
|
|
|
|
267
|
- $content2 .= '前三页关键词数量为:'.$data['keyword_three_num'].'个,';
|
|
|
|
268
|
- }
|
|
|
|
269
|
- if(!empty($data['keyword_five_num'])){
|
|
|
|
270
|
- $content2 .= '前五页关键词数量为:'.$data['keyword_five_num'].'个,';
|
|
|
|
271
|
- }
|
|
|
|
272
|
- if(!empty($data['keyword_ten_num'])){
|
|
|
|
273
|
- $content2 .= '前十页关键词数量为:'.$data['keyword_ten_num'].'个,';
|
|
|
|
274
|
- }
|
|
|
|
275
|
- }
|
|
|
|
276
|
- if(!empty($data['daily_average_num'])){
|
|
|
|
277
|
- $content2 .= '本周日均访客量:'.$data['daily_average_num'].'+。';
|
|
|
|
278
|
- }
|
|
|
|
279
|
- $content2 .= '全球搜建议用户持续分析、选择、添加企业、产品、服务等相关关键词进行优化和监控,以覆盖更多相关排名和流量;';
|
|
|
|
280
|
- }
|
|
|
|
281
|
- if(!empty($content2)){
|
|
|
|
282
|
- $arr[] = $content2;
|
|
|
|
283
|
- }
|
|
|
|
284
|
- $content3 = '';
|
|
|
|
285
|
- if(!empty($data['product_num']) || !empty($data['news_num']) || !empty($data['week_product_num']) || !empty($data['week_news_num'])){
|
|
|
|
286
|
- if(!empty($data['product_num']) || !empty($data['news_num'])){
|
|
|
|
287
|
- $content3 .= '项目截止目前';
|
|
|
|
288
|
- if(!empty($data['product_num'])){
|
|
|
|
289
|
- $content3 .= '发布产品:'.$data['product_num'].'条,';
|
|
|
|
290
|
- }
|
|
|
|
291
|
- if(!empty($data['news_num'])){
|
|
|
|
292
|
- $content3 .= '发布新闻:'.$data['news_num'].'条。';
|
|
|
|
293
|
- }
|
|
|
|
294
|
- }
|
|
|
|
295
|
- if(!empty($data['week_product_num']) || !empty($data['week_news_num'])){
|
|
|
|
296
|
- $content3 .= '本周新增';
|
|
|
|
297
|
- if(!empty($data['week_product_num'])){
|
|
|
|
298
|
- $content3 .= '产品:'.$data['week_product_num'].'条,';
|
|
|
|
299
|
- }
|
|
|
|
300
|
- if(!empty($data['week_news_num'])){
|
|
|
|
301
|
- $content3 .= '新闻:'.$data['week_news_num'].'条。';
|
188
|
+ public function downloadItem($filed = ['id','depth','created_at','referrer_url','url','device_port','country','ip']){
|
|
|
|
189
|
+ $visitModel = new Visit();
|
|
|
|
190
|
+ $page = 1;
|
|
|
|
191
|
+ $pageSize = 3000;
|
|
|
|
192
|
+ $lists = $visitModel->lists(['updated_date'=>['between',['2025-02-01','2025-02-31']]],$page,$pageSize,'id',$filed);
|
|
|
|
193
|
+ foreach ($lists as $v){
|
|
|
|
194
|
+ $customer_visit_id[] = $v['id'];
|
|
|
|
195
|
+ }
|
|
|
|
196
|
+ $itemModel = new VisitItem();
|
|
|
|
197
|
+ $itemList = $itemModel->list(['customer_visit_id'=>['in',$customer_visit_id]],['customer_visit_id','url']);
|
|
|
|
198
|
+ foreach ($lists as $key => $value){
|
|
|
|
199
|
+ $sub = [];
|
|
|
|
200
|
+ foreach ($itemList as $sonValue){
|
|
|
|
201
|
+ if($value['id'] == $sonValue['customer_visit_id']){
|
|
|
|
202
|
+ $sub[] = $sonValue;
|
|
302
|
}
|
203
|
}
|
|
303
|
}
|
204
|
}
|
|
304
|
- $content3 .= '全球搜建议用户保持网站内容的持续更新与完善,可参考谷歌关于创建实用、可靠、以用户为中心的内容的相关建议:https://developers.google.com/search/docs/fundamentals/creating-helpful-content?hl=zh-cn;';
|
|
|
|
305
|
- }
|
|
|
|
306
|
- if(!empty($content3)){
|
|
|
|
307
|
- $arr[] = $content3;
|
|
|
|
308
|
- }
|
|
|
|
309
|
- $content4 = '';
|
|
|
|
310
|
- if(!empty($data['main_update_num'])){
|
|
|
|
311
|
- $content4 .= '网站加载速度维护及主站页面更新'.$data['main_update_num'].'次。';
|
|
|
|
312
|
- }
|
|
|
|
313
|
- if(!empty($data['aggregation_update_num'])){
|
|
|
|
314
|
- $content4 .= '聚合页主站页面更新'.$data['aggregation_update_num'].'次。';
|
|
|
|
315
|
- }
|
|
|
|
316
|
- if(!empty($data['aggregation_update_num'])){
|
|
|
|
317
|
- $content4 .= '聚合页主站页面更新'.$data['aggregation_update_num'].'次。';
|
205
|
+ $value['sub'] = $sub;
|
|
|
|
206
|
+ $lists[$key] = $value;
|
|
318
|
}
|
207
|
}
|
|
319
|
- if(!empty($data['minor_update_num'])){
|
|
|
|
320
|
- $content4 .= '小语种站页面更新'.$data['minor_update_num'].'次。';
|
|
|
|
321
|
- }
|
|
|
|
322
|
- if(!empty($data['aggregation_minor_update_num'])){
|
|
|
|
323
|
- $content4 .= '聚合页小语种站页面'.$data['aggregation_minor_update_num'].'次。';
|
|
|
|
324
|
- }
|
|
|
|
325
|
- if(!empty($content4)){
|
|
|
|
326
|
- $content4 = '本周主要优化工作包括:TDK、H标签、Img标签等优化设置排查与进一步完善,Sitemap更新与网页收录提交,外链新增与排查。'.$content4;
|
|
|
|
327
|
- }
|
|
|
|
328
|
- if(!empty($content4)){
|
|
|
|
329
|
- $arr[] = $content4;
|
|
|
|
330
|
- }
|
|
|
|
331
|
- if(empty($arr)){
|
|
|
|
332
|
- return true;
|
|
|
|
333
|
- }
|
|
|
|
334
|
- foreach ($arr as $key => $val){
|
|
|
|
335
|
- $content .= ($key+1).','.$val.PHP_EOL;
|
|
|
|
336
|
- }
|
|
|
|
337
|
- $timestamp = strtotime('tomorrow 9:00 AM');
|
|
|
|
338
|
- $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
|
|
|
|
339
|
- if(empty($content)){
|
|
|
|
340
|
- return true;
|
|
|
|
341
|
- }
|
|
|
|
342
|
- $tips = 'Tips:'.PHP_EOL.'1、全球搜V6.0系统提供网页TDK、H标签、Img标签等用户自定义编辑接口且辅以AI创作工具,用户可进一步对相关优化设置进行精细化优化与调整;'.PHP_EOL.'2、全球搜V6.0系统提供小语种页面精准校对翻译功能,用户可进一步对已翻译小语种页面进行人工翻译校对;'.PHP_EOL.'3、全球搜V6.0系统支持绑定Facebook、LinkedIn、X(原Twitter)等社媒账号,可一键同步转发网站上发布的产品和新闻至社媒账号动态,建议用户用起来哦;'.PHP_EOL.'4、如用户有较丰富的企业、产品、服务相关视频素材,全球搜建议用户及时创建YouTube主页,并在YouTube和网站相关网页上同步发布视频;';
|
|
|
|
343
|
- $param = [
|
|
|
|
344
|
- 'project_id'=>$project_id,
|
|
|
|
345
|
- 'friend_id'=>17667,
|
|
|
|
346
|
- 'type'=>MessagePush::TYPE_WEEK,
|
|
|
|
347
|
- 'content'=>"【全球搜V6.0周报】--项目id:$project_id".PHP_EOL.$content.PHP_EOL.$tips,
|
|
|
|
348
|
- 'ref_ids'=>'',
|
|
|
|
349
|
- 'send_time'=>$tomorrowNineAM,
|
|
|
|
350
|
- 'status'=>0,
|
|
|
|
351
|
- ];
|
|
|
|
352
|
- //写入一条推送消息 自动消费
|
|
|
|
353
|
- $messagePushModel = new MessagePush();
|
|
|
|
354
|
- $messagePushModel->add($param);
|
|
|
|
355
|
- echo date('Y-m-d H:i:s') . '数据:'. $content . PHP_EOL;
|
|
|
|
356
|
- return true;
|
208
|
+ return $lists;
|
|
357
|
}
|
209
|
}
|
|
|
|
210
|
+
|
|
358
|
} |
211
|
} |