合并分支 'master-server' 到 'master'
gx创建作者 查看合并请求 !1210
正在显示
2 个修改的文件
包含
33 行增加
和
36 行删除
| @@ -7,17 +7,13 @@ | @@ -7,17 +7,13 @@ | ||
| 7 | * @time :2024/9/26 14:19 | 7 | * @time :2024/9/26 14:19 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands\Project; | 10 | +namespace App\Console\Commands\LyhTest; |
| 11 | 11 | ||
| 12 | use App\Helper\Common; | 12 | use App\Helper\Common; |
| 13 | -use App\Models\Domain\DomainInfo; | ||
| 14 | use App\Models\Product\Category; | 13 | use App\Models\Product\Category; |
| 15 | use App\Models\Product\CategoryRelated; | 14 | use App\Models\Product\CategoryRelated; |
| 16 | -use App\Models\Product\Detail; | ||
| 17 | use App\Models\Product\Product; | 15 | use App\Models\Product\Product; |
| 18 | use App\Models\RouteMap\RouteMap; | 16 | use App\Models\RouteMap\RouteMap; |
| 19 | -use App\Models\Visit\Visit; | ||
| 20 | -use App\Models\Visit\VisitItem; | ||
| 21 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 22 | use Illuminate\Console\Command; | 18 | use Illuminate\Console\Command; |
| 23 | use Illuminate\Support\Facades\DB; | 19 | use Illuminate\Support\Facades\DB; |
| @@ -41,7 +37,7 @@ class DownloadProject extends Command | @@ -41,7 +37,7 @@ class DownloadProject extends Command | ||
| 41 | protected $description = '导出项目数据'; | 37 | protected $description = '导出项目数据'; |
| 42 | 38 | ||
| 43 | public function handle(){ | 39 | public function handle(){ |
| 44 | - ProjectServer::useProject(1225); | 40 | + ProjectServer::useProject(1646); |
| 45 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; | 41 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; |
| 46 | $data = $this->downloadProduct(); | 42 | $data = $this->downloadProduct(); |
| 47 | DB::disconnect('custom_mysql'); | 43 | DB::disconnect('custom_mysql'); |
| @@ -52,22 +48,23 @@ class DownloadProject extends Command | @@ -52,22 +48,23 @@ class DownloadProject extends Command | ||
| 52 | public function downloadProduct() | 48 | public function downloadProduct() |
| 53 | { | 49 | { |
| 54 | $product = new Product(); | 50 | $product = new Product(); |
| 55 | - $filed = ['id', 'project_id', 'title' ,'thumb' , 'route' ,'intro','content', | ||
| 56 | - 'category_id', 'status','seo_mate']; | 51 | +// $filed = ['id', 'project_id', 'title' ,'thumb' , 'route' ,'intro','content', |
| 52 | +// 'category_id', 'status','seo_mate']; | ||
| 53 | + $filed = ['id','title']; | ||
| 57 | $this->order = 'sort'; | 54 | $this->order = 'sort'; |
| 58 | $lists = $product->list(['status'=>1],'id',$filed); | 55 | $lists = $product->list(['status'=>1],'id',$filed); |
| 59 | if(!empty($lists)){ | 56 | if(!empty($lists)){ |
| 60 | - $cate_data = $this->getCategoryList();//分类 | 57 | +// $cate_data = $this->getCategoryList();//分类 |
| 61 | foreach ($lists as $k => $v){ | 58 | foreach ($lists as $k => $v){ |
| 62 | echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL; | 59 | echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL; |
| 63 | - $v['url'] = 'https://www.autsikinta.com/' . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']); | ||
| 64 | - $v['category_id_text'] = $this->categoryName($v['id'],$cate_data); | ||
| 65 | - //ToDo::处理图片及文件 | ||
| 66 | - if(!empty($v['thumb']) && !empty($v['thumb']['url'])){ | ||
| 67 | - $v['images'] = getImageUrl($v['thumb']['url']); | ||
| 68 | - }else{ | ||
| 69 | - $v['images'] = ''; | ||
| 70 | - } | 60 | +// $v['url'] = 'https://www.autsikinta.com/' . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']); |
| 61 | +// $v['category_id_text'] = $this->categoryName($v['id'],$cate_data); | ||
| 62 | +// //ToDo::处理图片及文件 | ||
| 63 | +// if(!empty($v['thumb']) && !empty($v['thumb']['url'])){ | ||
| 64 | +// $v['images'] = getImageUrl($v['thumb']['url']); | ||
| 65 | +// }else{ | ||
| 66 | +// $v['images'] = ''; | ||
| 67 | +// } | ||
| 71 | $lists[$k] = $v; | 68 | $lists[$k] = $v; |
| 72 | } | 69 | } |
| 73 | } | 70 | } |
| @@ -148,27 +145,27 @@ class DownloadProject extends Command | @@ -148,27 +145,27 @@ class DownloadProject extends Command | ||
| 148 | $sheet = $spreadsheet->getActiveSheet(); | 145 | $sheet = $spreadsheet->getActiveSheet(); |
| 149 | // 添加表头 | 146 | // 添加表头 |
| 150 | $sheet->setCellValue('A1', '产品名称'); | 147 | $sheet->setCellValue('A1', '产品名称'); |
| 151 | - $sheet->setCellValue('B1', '产品短描述'); | ||
| 152 | - $sheet->setCellValue('C1', '产品内容'); | ||
| 153 | - $sheet->setCellValue('D1', '产品路由'); | ||
| 154 | - $sheet->setCellValue('E1', '产品分类'); | ||
| 155 | - $sheet->setCellValue('F1', '产品状态'); | ||
| 156 | - $sheet->setCellValue('G1', '产品主图'); | ||
| 157 | - $sheet->setCellValue('H1', '产品seo_title'); | ||
| 158 | - $sheet->setCellValue('I1', '产品seo_keyword'); | ||
| 159 | - $sheet->setCellValue('J1', '产品seo_title'); | 148 | +// $sheet->setCellValue('B1', '产品短描述'); |
| 149 | +// $sheet->setCellValue('C1', '产品内容'); | ||
| 150 | +// $sheet->setCellValue('D1', '产品路由'); | ||
| 151 | +// $sheet->setCellValue('E1', '产品分类'); | ||
| 152 | +// $sheet->setCellValue('F1', '产品状态'); | ||
| 153 | +// $sheet->setCellValue('G1', '产品主图'); | ||
| 154 | +// $sheet->setCellValue('H1', '产品seo_title'); | ||
| 155 | +// $sheet->setCellValue('I1', '产品seo_keyword'); | ||
| 156 | +// $sheet->setCellValue('J1', '产品seo_title'); | ||
| 160 | $rowCount = 2; | 157 | $rowCount = 2; |
| 161 | foreach ($data as $v) { | 158 | foreach ($data as $v) { |
| 162 | $sheet->setCellValue('A' . $rowCount, $v['title']); | 159 | $sheet->setCellValue('A' . $rowCount, $v['title']); |
| 163 | - $sheet->setCellValue('B' . $rowCount, $v['intro']); | ||
| 164 | - $sheet->setCellValue('C' . $rowCount, $v['content']); | ||
| 165 | - $sheet->setCellValue('D' . $rowCount, $v['url']); | ||
| 166 | - $sheet->setCellValue('E' . $rowCount, $v['category_id_text']); | ||
| 167 | - $sheet->setCellValue('F' . $rowCount, '发布中'); | ||
| 168 | - $sheet->setCellValue('G' . $rowCount, $v['images']); | ||
| 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']); | 160 | +// $sheet->setCellValue('B' . $rowCount, $v['intro']); |
| 161 | +// $sheet->setCellValue('C' . $rowCount, $v['content']); | ||
| 162 | +// $sheet->setCellValue('D' . $rowCount, $v['url']); | ||
| 163 | +// $sheet->setCellValue('E' . $rowCount, $v['category_id_text']); | ||
| 164 | +// $sheet->setCellValue('F' . $rowCount, '发布中'); | ||
| 165 | +// $sheet->setCellValue('G' . $rowCount, $v['images']); | ||
| 166 | +// $sheet->setCellValue('H' . $rowCount, $v['seo_mate']['title']); | ||
| 167 | +// $sheet->setCellValue('I' . $rowCount, $v['seo_mate']['keyword']); | ||
| 168 | +// $sheet->setCellValue('J' . $rowCount, $v['seo_mate']['description']); | ||
| 172 | $rowCount++; | 169 | $rowCount++; |
| 173 | } | 170 | } |
| 174 | // 创建一个新的 Excel Writer 对象 | 171 | // 创建一个新的 Excel Writer 对象 |
-
请 注册 或 登录 后发表评论