|
@@ -54,7 +54,7 @@ class WeekProject extends Command |
|
@@ -54,7 +54,7 @@ class WeekProject extends Command |
|
54
|
*/
|
54
|
*/
|
|
55
|
public function handle(){
|
55
|
public function handle(){
|
|
56
|
$projectModel = new Project();
|
56
|
$projectModel = new Project();
|
|
57
|
- $list = $projectModel->list(['delete_status'=>0,'is_weekly_report'=>1,'type'=>['in',[1,2,3,4,6]]],'id',['id','title']);
|
57
|
+ $list = $projectModel->list(['delete_status'=>0,'type'=>['in',[1,2,3,4,6]]],'id',['id','title','is_weekly_report','main_lang_id']);
|
|
58
|
$domainModel = new DomainInfo();
|
58
|
$domainModel = new DomainInfo();
|
|
59
|
foreach ($list as $k => $v){
|
59
|
foreach ($list as $k => $v){
|
|
60
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
60
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
@@ -83,6 +83,7 @@ class WeekProject extends Command |
|
@@ -83,6 +83,7 @@ class WeekProject extends Command |
|
83
|
$data = [
|
83
|
$data = [
|
|
84
|
'project_id'=>$value['id'],
|
84
|
'project_id'=>$value['id'],
|
|
85
|
'title'=>$value['title'],
|
85
|
'title'=>$value['title'],
|
|
|
|
86
|
+ 'main_lang_id'=>$value['main_lang_id'],
|
|
86
|
];
|
87
|
];
|
|
87
|
// 上一周的开始时间(周一 00:00:00)
|
88
|
// 上一周的开始时间(周一 00:00:00)
|
|
88
|
$startOfLastWeek = strtotime("last week monday");
|
89
|
$startOfLastWeek = strtotime("last week monday");
|
|
@@ -134,9 +135,12 @@ class WeekProject extends Command |
|
@@ -134,9 +135,12 @@ class WeekProject extends Command |
|
134
|
if($pv_num_count != 0){
|
135
|
if($pv_num_count != 0){
|
|
135
|
$data['daily_average_num'] = round($pv_num_count / 7,2);
|
136
|
$data['daily_average_num'] = round($pv_num_count / 7,2);
|
|
136
|
}
|
137
|
}
|
|
|
|
138
|
+
|
|
|
|
139
|
+ if($value['is_weekly_report'] != 0){
|
|
|
|
140
|
+ $this->workChatMessage($data,$value['id']);
|
|
|
|
141
|
+ }
|
|
137
|
$v6WeeklyReportModel = new V6WeeklyReport();
|
142
|
$v6WeeklyReportModel = new V6WeeklyReport();
|
|
138
|
$v6WeeklyReportModel->add($data);
|
143
|
$v6WeeklyReportModel->add($data);
|
|
139
|
- $this->workChatMessage($data,$value['id']);
|
|
|
|
140
|
return true;
|
144
|
return true;
|
|
141
|
}
|
145
|
}
|
|
142
|
|
146
|
|
|
@@ -184,14 +188,27 @@ class WeekProject extends Command |
|
@@ -184,14 +188,27 @@ class WeekProject extends Command |
|
184
|
$content2 = '';
|
188
|
$content2 = '';
|
|
185
|
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'])){
|
189
|
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'])){
|
|
186
|
$content2 .= '项目截止目前';
|
190
|
$content2 .= '项目截止目前';
|
|
|
|
191
|
+ if($data['main_lang_id'] == 8){
|
|
|
|
192
|
+ $title = 'Yandex';
|
|
|
|
193
|
+ }else{
|
|
|
|
194
|
+ $title = '谷歌';
|
|
|
|
195
|
+ }
|
|
187
|
if(!empty($data['google_indexed_num'])){
|
196
|
if(!empty($data['google_indexed_num'])){
|
|
188
|
- $content2 .= '谷歌收录量:'.$data['google_indexed_num'].'条,';
|
197
|
+ $content2 .= $title.'收录量:'.$data['google_indexed_num'].'条,';
|
|
189
|
}
|
198
|
}
|
|
190
|
if(!empty($data['google_links_num'])){
|
199
|
if(!empty($data['google_links_num'])){
|
|
191
|
- $content2 .= '外链量:'.$data['google_links_num'].'条,';
|
200
|
+ //获取上一次的外链数
|
|
|
|
201
|
+ $latestRecord = V6WeeklyReport::where(['project_id'=>$project_id])->orderBy('id', 'desc')->first();
|
|
|
|
202
|
+ if(!empty($latestRecord)){
|
|
|
|
203
|
+ if($latestRecord['google_links_num'] != $data['google_links_num']){
|
|
|
|
204
|
+ $content2 .= '外链量:'.$data['google_links_num'].'条,';
|
|
|
|
205
|
+ }
|
|
|
|
206
|
+ }else{
|
|
|
|
207
|
+ $content2 .= '外链量:'.$data['google_links_num'].'条,';
|
|
|
|
208
|
+ }
|
|
192
|
}
|
209
|
}
|
|
193
|
if(!empty($data['keyword_home_num']) || !empty($data['keyword_three_num']) || !empty($data['keyword_five_num']) || !empty($data['keyword_ten_num'])){
|
210
|
if(!empty($data['keyword_home_num']) || !empty($data['keyword_three_num']) || !empty($data['keyword_five_num']) || !empty($data['keyword_ten_num'])){
|
|
194
|
- $content2 .= '谷歌搜索排名';
|
211
|
+ $content2 .= $title.'搜索排名';
|
|
195
|
if(!empty($data['keyword_home_num'])){
|
212
|
if(!empty($data['keyword_home_num'])){
|
|
196
|
$content2 .= '首页关键词数量为:'.$data['keyword_home_num'].'个,';
|
213
|
$content2 .= '首页关键词数量为:'.$data['keyword_home_num'].'个,';
|
|
197
|
}
|
214
|
}
|