作者 lyh

gx

... ... @@ -56,14 +56,12 @@ class Demo extends Command
$projectModel = new Project();
$list = $projectModel->list(['type'=>['!=',0],'delete_status'=>0]);
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$templateComModel = new BTemplateCom();
$templateComModel->edit(['source'=>2],['source'=>3,'is_list'=>1,'is_custom'=>0]);
$templateComModel->edit(['source'=>3],['source'=>4,'is_list'=>0,'is_custom'=>0]);
$templateComModel->edit(['source'=>3],['source'=>5,'is_list'=>1,'is_custom'=>0]);
$templateComModel->edit(['source'=>4],['source'=>6,'is_list'=>0,'is_custom'=>0]);
$templateComModel->edit(['source'=>4],['source'=>7,'is_list'=>1,'is_custom'=>0]);
$info = $templateComModel->read(['source'=>5,'is_list'=>0]);
if($info !== false){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
}
DB::disconnect('custom_mysql');
}
... ...
... ... @@ -77,6 +77,28 @@ class HeaderFooter extends Command
$commonList = $templateCommonModel->list(['template_id'=>['in',[$settingInfo['template_id'],0]]]);
if(!empty($commonList)){
foreach ($commonList as $v){
if($v['is_custom'] == 0){
if($v['type'] == 3){
$v['type'] = 2;
$v['is_list'] = 1;
}
if($v['type'] == 4){
$v['type'] = 3;
$v['is_list'] = 0;
}
if($v['type'] == 5){
$v['type'] = 3;
$v['is_list'] = 1;
}
if($v['type'] == 6){
$v['type'] = 4;
$v['is_list'] = 0;
}
if($v['type'] == 7){
$v['type'] = 4;
$v['is_list'] = 1;
}
}
$typeArr = [1, 2, 3];
foreach ($typeArr as $type){
if($type == 1){
... ...