|
...
|
...
|
@@ -80,22 +80,25 @@ class UpdateBuildConfiguration extends Command |
|
|
|
*/
|
|
|
|
public function getProduct(){
|
|
|
|
$productModel = new Product();
|
|
|
|
$lists = $productModel->list();
|
|
|
|
$lists = $productModel->list([],'id',['id','content']);
|
|
|
|
$detailModel = new Detail();
|
|
|
|
if(!empty($lists)){
|
|
|
|
foreach ($lists as $k => $v){
|
|
|
|
echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;
|
|
|
|
$data = [
|
|
|
|
'product_id'=>$v['id'],
|
|
|
|
'column_id'=>1,
|
|
|
|
'text_type'=>1,
|
|
|
|
'title'=>'',
|
|
|
|
'sort'=>1,
|
|
|
|
'content'=>json_encode(['content'=>$v['describe']],true),
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s')
|
|
|
|
];
|
|
|
|
$detailModel->insert($data);
|
|
|
|
$info = $detailModel->read(['product_id'=>$v['id']],['id']);
|
|
|
|
if($info === false){
|
|
|
|
$data = [
|
|
|
|
'product_id'=>$v['id'],
|
|
|
|
'column_id'=>1,
|
|
|
|
'text_type'=>1,
|
|
|
|
'title'=>'',
|
|
|
|
'sort'=>1,
|
|
|
|
'content'=>json_encode(['content'=>$v['describe']],true),
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s')
|
|
|
|
];
|
|
|
|
$detailModel->insert($data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
...
|
...
|
|