|
@@ -32,7 +32,10 @@ class UpdateController extends BaseController |
|
@@ -32,7 +32,10 @@ class UpdateController extends BaseController |
|
32
|
* @time :2023/8/19 9:25
|
32
|
* @time :2023/8/19 9:25
|
|
33
|
*/
|
33
|
*/
|
|
34
|
public function updateSeoTdk(){
|
34
|
public function updateSeoTdk(){
|
|
35
|
-
|
35
|
+ $this->updateProduct();
|
|
|
|
36
|
+ $this->updateBlogs();
|
|
|
|
37
|
+ $this->updateNews();
|
|
|
|
38
|
+ $this->response('success');
|
|
36
|
}
|
39
|
}
|
|
37
|
|
40
|
|
|
38
|
/**
|
41
|
/**
|
|
@@ -60,7 +63,7 @@ class UpdateController extends BaseController |
|
@@ -60,7 +63,7 @@ class UpdateController extends BaseController |
|
60
|
}
|
63
|
}
|
|
61
|
//更新seo_keyword
|
64
|
//更新seo_keyword
|
|
62
|
if(!isset($seo_arr['description'])){
|
65
|
if(!isset($seo_arr['description'])){
|
|
63
|
- $seo_arr['description'] = $this->ai_send('product_seo_description',$v['title']);;
|
66
|
+ $seo_arr['description'] = $this->ai_send('product_seo_description',$v['title']);
|
|
64
|
}
|
67
|
}
|
|
65
|
$ser_str = json_encode($seo_arr,true);
|
68
|
$ser_str = json_encode($seo_arr,true);
|
|
66
|
$productModel->edit(['seo_mate'=>$ser_str],['id'=>$v['id']]);
|
69
|
$productModel->edit(['seo_mate'=>$ser_str],['id'=>$v['id']]);
|
|
@@ -79,20 +82,23 @@ class UpdateController extends BaseController |
|
@@ -79,20 +82,23 @@ class UpdateController extends BaseController |
|
79
|
*/
|
82
|
*/
|
|
80
|
public function updateNews(){
|
83
|
public function updateNews(){
|
|
81
|
$newsModel = new News();
|
84
|
$newsModel = new News();
|
|
82
|
- $list = $newsModel->list(['status'=>$newsModel::STATUS_ONE]);
|
85
|
+ $list = $newsModel->list(['status'=>$newsModel::STATUS_ONE],'id',['id','name','seo_title','seo_keywords','seo_description']);
|
|
83
|
if(!empty($list)){
|
86
|
if(!empty($list)){
|
|
84
|
foreach ($list as $k => $v){
|
87
|
foreach ($list as $k => $v){
|
|
85
|
- if(!empty($v['seo_title'])){
|
|
|
|
86
|
-
|
88
|
+ $data = [];
|
|
|
|
89
|
+ if(empty($v['seo_title'])){
|
|
|
|
90
|
+ $data['seo_title'] = $this->ai_send('news_seo_title',$v['name']);
|
|
87
|
}
|
91
|
}
|
|
88
|
- if(!empty($v['seo_keywords'])){
|
|
|
|
89
|
-
|
92
|
+ if(empty($v['seo_keywords'])){
|
|
|
|
93
|
+ $data['seo_keywords'] = $this->ai_send('news_seo_keyword',$v['name']);
|
|
90
|
}
|
94
|
}
|
|
91
|
- if(!empty($v['seo_description'])){
|
|
|
|
92
|
-
|
95
|
+ if(empty($v['seo_description'])){
|
|
|
|
96
|
+ $data['seo_description'] = $this->ai_send('news_seo_description',$v['name']);
|
|
93
|
}
|
97
|
}
|
|
|
|
98
|
+ $newsModel->edit($data,['id'=>$v['id']]);
|
|
94
|
}
|
99
|
}
|
|
95
|
}
|
100
|
}
|
|
|
|
101
|
+ return true;
|
|
96
|
}
|
102
|
}
|
|
97
|
|
103
|
|
|
98
|
/**
|
104
|
/**
|
|
@@ -107,9 +113,20 @@ class UpdateController extends BaseController |
|
@@ -107,9 +113,20 @@ class UpdateController extends BaseController |
|
107
|
$list = $blogModel->list(['status'=>$blogModel::STATUS_ONE]);
|
113
|
$list = $blogModel->list(['status'=>$blogModel::STATUS_ONE]);
|
|
108
|
if(!empty($list)){
|
114
|
if(!empty($list)){
|
|
109
|
foreach ($list as $k => $v){
|
115
|
foreach ($list as $k => $v){
|
|
110
|
-
|
116
|
+ $data = [];
|
|
|
|
117
|
+ if(empty($v['seo_title'])){
|
|
|
|
118
|
+ $data['seo_title'] = $this->ai_send('blog_seo_title',$v['name']);
|
|
|
|
119
|
+ }
|
|
|
|
120
|
+ if(empty($v['seo_keywords'])){
|
|
|
|
121
|
+ $data['seo_keywords'] = $this->ai_send('blog_seo_keyword',$v['name']);
|
|
|
|
122
|
+ }
|
|
|
|
123
|
+ if(empty($v['seo_description'])){
|
|
|
|
124
|
+ $data['seo_description'] = $this->ai_send('blog_seo_description',$v['name']);
|
|
|
|
125
|
+ }
|
|
|
|
126
|
+ $blogModel->edit($data,['id'=>$v['id']]);
|
|
111
|
}
|
127
|
}
|
|
112
|
}
|
128
|
}
|
|
|
|
129
|
+ return true;
|
|
113
|
}
|
130
|
}
|
|
114
|
|
131
|
|
|
115
|
/**
|
132
|
/**
|