|
...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
namespace App\Console\Commands\Test;
|
|
|
|
|
|
|
|
use App\Models\Product\Column;
|
|
|
|
use App\Models\Product\Detail;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
...
|
...
|
@@ -61,7 +62,7 @@ class UpdateBuildConfiguration extends Command |
|
|
|
*/
|
|
|
|
public function handle(){
|
|
|
|
$projectModel = new Project();
|
|
|
|
$list = $projectModel->list(['delete_status'=>0,'id'=>['in',[1671,1718]]],'id',['id'],'asc');
|
|
|
|
$list = $projectModel->list(['delete_status'=>0,'id'=>['not in',[1671,1718]]],'id',['id'],'asc');
|
|
|
|
foreach ($list as $k => $v){
|
|
|
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
|
|
ProjectServer::useProject($v['id']);
|
|
...
|
...
|
@@ -83,24 +84,12 @@ class UpdateBuildConfiguration extends Command |
|
|
|
$productModel = new Product();
|
|
|
|
$page = 1;
|
|
|
|
while (true){
|
|
|
|
$lists = $productModel->lists([],$page,10,['id','describe']);
|
|
|
|
$lists = $productModel->lists([],$page,100,['id','content','describe']);
|
|
|
|
$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;
|
|
|
|
}
|
|
|
|
foreach ($v['describe'] as $key => $value){
|
|
|
|
if(isset($value['title']) && ($value['title'] == null)){
|
|
|
|
$value['title'] = '';
|
|
|
|
}
|
|
|
|
if(isset($value['text']) && ($value['text'] == null)){
|
|
|
|
$value['text'] = '';
|
|
|
|
}
|
|
|
|
if(empty($value['text'])){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(!empty($v['content'])){
|
|
|
|
$data = [
|
|
|
|
'product_id'=>$v['id'],
|
|
|
|
'column_id'=>1,
|
|
...
|
...
|
@@ -113,6 +102,33 @@ class UpdateBuildConfiguration extends Command |
|
|
|
];
|
|
|
|
$detailModel->insert($data);
|
|
|
|
}
|
|
|
|
if(!empty($v['describe'])){
|
|
|
|
foreach ($v['describe'] as $key => $value){
|
|
|
|
if(isset($value['title']) && ($value['title'] == null)){
|
|
|
|
$value['title'] = '';
|
|
|
|
}
|
|
|
|
if(isset($value['text']) && ($value['text'] == null)){
|
|
|
|
$value['text'] = '';
|
|
|
|
}
|
|
|
|
if(empty($value['title'])){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
//添加切换栏
|
|
|
|
$c = new Column();
|
|
|
|
$id = $c->addReturnId(['column_name'=>$value['title'],'product_id'=>$v['id']]);
|
|
|
|
$dataS = [
|
|
|
|
'product_id'=>$v['id'],
|
|
|
|
'column_id'=>$id,
|
|
|
|
'text_type'=>1,
|
|
|
|
'title'=>$value['title'] ?? '',
|
|
|
|
'sort'=>$key + 1,
|
|
|
|
'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')
|
|
|
|
];
|
|
|
|
$detailModel->insert($dataS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
break;
|
...
|
...
|
|