作者 lyh

gx脚本导出产品

... ... @@ -43,7 +43,7 @@ class DownloadProject extends Command
$data = $this->downloadProduct();
DB::disconnect('custom_mysql');
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
// return $this->exportData($data);
return $this->exportData($data);
}
public function downloadProduct()
... ... @@ -55,16 +55,7 @@ class DownloadProject extends Command
$lists = $product->list(['status'=>1],'id',$filed);
if(!empty($lists)){
$cate_data = $this->getCategoryList();//分类
$detailModel = new Detail();
foreach ($lists as $k => $v){
$detailInfo = $detailModel->read(['product_id'=>$v['id'],'column_id'=>1,'text_type'=>1],['content']);
if($detailInfo === false || ($detailInfo['content']['content'] == null)){
$v['content'] = '';
}else{
echo date('Y-m-d H:i:s') . '数据详情$v:'. json_encode($detailInfo) . PHP_EOL;
die();
$v['content'] = $detailInfo['content']['content'];
}
$v['url'] = 'https://www.autsikinta.com/' . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']);
$v['category_id_text'] = $this->categoryName($v['id'],$cate_data);
//ToDo::处理图片及文件
... ...