|
@@ -42,6 +42,7 @@ class DownloadProject extends Command |
|
@@ -42,6 +42,7 @@ class DownloadProject extends Command |
|
42
|
|
42
|
|
|
43
|
public function handle(){
|
43
|
public function handle(){
|
|
44
|
ProjectServer::useProject(1225);
|
44
|
ProjectServer::useProject(1225);
|
|
|
|
45
|
+ echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
|
|
45
|
$data = $this->downloadProduct();
|
46
|
$data = $this->downloadProduct();
|
|
46
|
DB::disconnect('custom_mysql');
|
47
|
DB::disconnect('custom_mysql');
|
|
47
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
48
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
@@ -58,6 +59,7 @@ class DownloadProject extends Command |
|
@@ -58,6 +59,7 @@ class DownloadProject extends Command |
|
58
|
if(!empty($lists)){
|
59
|
if(!empty($lists)){
|
|
59
|
$cate_data = $this->getCategoryList();//分类
|
60
|
$cate_data = $this->getCategoryList();//分类
|
|
60
|
foreach ($lists as $k => $v){
|
61
|
foreach ($lists as $k => $v){
|
|
|
|
62
|
+ echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;
|
|
61
|
$v['url'] = 'https://www.autsikinta.com/' . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']);
|
63
|
$v['url'] = 'https://www.autsikinta.com/' . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']);
|
|
62
|
$v['category_id_text'] = $this->categoryName($v['id'],$cate_data);
|
64
|
$v['category_id_text'] = $this->categoryName($v['id'],$cate_data);
|
|
63
|
//ToDo::处理图片及文件
|
65
|
//ToDo::处理图片及文件
|
|
@@ -69,7 +71,6 @@ class DownloadProject extends Command |
|
@@ -69,7 +71,6 @@ class DownloadProject extends Command |
|
69
|
$lists[$k] = $v;
|
71
|
$lists[$k] = $v;
|
|
70
|
}
|
72
|
}
|
|
71
|
}
|
73
|
}
|
|
72
|
- echo date('Y-m-d H:i:s') . '数据详情$v:'. json_encode($lists) . PHP_EOL;
|
|
|
|
73
|
return $lists;
|
74
|
return $lists;
|
|
74
|
}
|
75
|
}
|
|
75
|
public function categoryName($product_id,$data){
|
76
|
public function categoryName($product_id,$data){
|
|
@@ -153,7 +154,9 @@ class DownloadProject extends Command |
|
@@ -153,7 +154,9 @@ class DownloadProject extends Command |
|
153
|
$sheet->setCellValue('E1', '产品分类');
|
154
|
$sheet->setCellValue('E1', '产品分类');
|
|
154
|
$sheet->setCellValue('F1', '产品状态');
|
155
|
$sheet->setCellValue('F1', '产品状态');
|
|
155
|
$sheet->setCellValue('G1', '产品主图');
|
156
|
$sheet->setCellValue('G1', '产品主图');
|
|
156
|
- $sheet->setCellValue('H1', '产品TDK');
|
157
|
+ $sheet->setCellValue('H1', '产品seo_title');
|
|
|
|
158
|
+ $sheet->setCellValue('I1', '产品seo_keyword');
|
|
|
|
159
|
+ $sheet->setCellValue('J1', '产品seo_title');
|
|
157
|
$rowCount = 2;
|
160
|
$rowCount = 2;
|
|
158
|
foreach ($data as $v) {
|
161
|
foreach ($data as $v) {
|
|
159
|
$sheet->setCellValue('A' . $rowCount, $v['title']);
|
162
|
$sheet->setCellValue('A' . $rowCount, $v['title']);
|
|
@@ -163,7 +166,9 @@ class DownloadProject extends Command |
|
@@ -163,7 +166,9 @@ class DownloadProject extends Command |
|
163
|
$sheet->setCellValue('E' . $rowCount, $v['category_id_text']);
|
166
|
$sheet->setCellValue('E' . $rowCount, $v['category_id_text']);
|
|
164
|
$sheet->setCellValue('F' . $rowCount, '发布中');
|
167
|
$sheet->setCellValue('F' . $rowCount, '发布中');
|
|
165
|
$sheet->setCellValue('G' . $rowCount, $v['images']);
|
168
|
$sheet->setCellValue('G' . $rowCount, $v['images']);
|
|
166
|
- $sheet->setCellValue('H' . $rowCount, $v['seo_mate']);
|
169
|
+ $sheet->setCellValue('H' . $rowCount, $v['seo_mate']['title']);
|
|
|
|
170
|
+ $sheet->setCellValue('I' . $rowCount, $v['seo_mate']['keyword']);
|
|
|
|
171
|
+ $sheet->setCellValue('J' . $rowCount, $v['seo_mate']['description']);
|
|
167
|
$rowCount++;
|
172
|
$rowCount++;
|
|
168
|
}
|
173
|
}
|
|
169
|
// 创建一个新的 Excel Writer 对象
|
174
|
// 创建一个新的 Excel Writer 对象
|