|
...
|
...
|
@@ -87,28 +87,27 @@ class UpdateBuildConfiguration extends Command |
|
|
|
$detailModel = new Detail();
|
|
|
|
if(!empty($lists['list'])){
|
|
|
|
foreach ($lists['list'] as $k => $v){
|
|
|
|
echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;
|
|
|
|
if(empty($v['describe'])){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(empty($v['describe'][0]['text'])){
|
|
|
|
continue;
|
|
|
|
foreach ($v['describe'] as $key => $value){
|
|
|
|
if(isset($value['title']) && ($value['title'] == null)){
|
|
|
|
$value['title'] = '';
|
|
|
|
}
|
|
|
|
if(isset($v['describe'][0]['title']) && ($v['describe'][0]['title'] == null)){
|
|
|
|
$v['describe'][0]['title'] = '';
|
|
|
|
if(isset($value['text']) && ($value['text'] == null)){
|
|
|
|
$value['text'] = '';
|
|
|
|
}
|
|
|
|
if(isset($v['describe'][0]['text']) && ($v['describe'][0]['text'] == null)){
|
|
|
|
$v['describe'][0]['text'] = '';
|
|
|
|
if(empty($value['text'])){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;
|
|
|
|
$info = $detailModel->read(['product_id'=>$v['id']],['id']);
|
|
|
|
if($info === false){
|
|
|
|
$data = [
|
|
|
|
'product_id'=>$v['id'],
|
|
|
|
'column_id'=>1,
|
|
|
|
'text_type'=>1,
|
|
|
|
'title'=>$v['describe'][0]['title'] ?? '',
|
|
|
|
'title'=>$value['title'] ?? '',
|
|
|
|
'sort'=>1,
|
|
|
|
'content'=>json_encode(['content'=>$v['describe'][0]['text'] ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
|
|
|
'content'=>json_encode(['content'=>$value['text'] ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s')
|
|
|
|
];
|
...
|
...
|
|