作者 lyh

gx

@@ -56,14 +56,12 @@ class Demo extends Command @@ -56,14 +56,12 @@ class Demo extends Command
56 $projectModel = new Project(); 56 $projectModel = new Project();
57 $list = $projectModel->list(['type'=>['!=',0],'delete_status'=>0]); 57 $list = $projectModel->list(['type'=>['!=',0],'delete_status'=>0]);
58 foreach ($list as $v){ 58 foreach ($list as $v){
59 - echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;  
60 ProjectServer::useProject($v['id']); 59 ProjectServer::useProject($v['id']);
61 $templateComModel = new BTemplateCom(); 60 $templateComModel = new BTemplateCom();
62 - $templateComModel->edit(['source'=>2],['source'=>3,'is_list'=>1,'is_custom'=>0]);  
63 - $templateComModel->edit(['source'=>3],['source'=>4,'is_list'=>0,'is_custom'=>0]);  
64 - $templateComModel->edit(['source'=>3],['source'=>5,'is_list'=>1,'is_custom'=>0]);  
65 - $templateComModel->edit(['source'=>4],['source'=>6,'is_list'=>0,'is_custom'=>0]);  
66 - $templateComModel->edit(['source'=>4],['source'=>7,'is_list'=>1,'is_custom'=>0]); 61 + $info = $templateComModel->read(['source'=>5,'is_list'=>0]);
  62 + if($info !== false){
  63 + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
  64 + }
67 DB::disconnect('custom_mysql'); 65 DB::disconnect('custom_mysql');
68 } 66 }
69 67
@@ -77,6 +77,28 @@ class HeaderFooter extends Command @@ -77,6 +77,28 @@ class HeaderFooter extends Command
77 $commonList = $templateCommonModel->list(['template_id'=>['in',[$settingInfo['template_id'],0]]]); 77 $commonList = $templateCommonModel->list(['template_id'=>['in',[$settingInfo['template_id'],0]]]);
78 if(!empty($commonList)){ 78 if(!empty($commonList)){
79 foreach ($commonList as $v){ 79 foreach ($commonList as $v){
  80 + if($v['is_custom'] == 0){
  81 + if($v['type'] == 3){
  82 + $v['type'] = 2;
  83 + $v['is_list'] = 1;
  84 + }
  85 + if($v['type'] == 4){
  86 + $v['type'] = 3;
  87 + $v['is_list'] = 0;
  88 + }
  89 + if($v['type'] == 5){
  90 + $v['type'] = 3;
  91 + $v['is_list'] = 1;
  92 + }
  93 + if($v['type'] == 6){
  94 + $v['type'] = 4;
  95 + $v['is_list'] = 0;
  96 + }
  97 + if($v['type'] == 7){
  98 + $v['type'] = 4;
  99 + $v['is_list'] = 1;
  100 + }
  101 + }
80 $typeArr = [1, 2, 3]; 102 $typeArr = [1, 2, 3];
81 foreach ($typeArr as $type){ 103 foreach ($typeArr as $type){
82 if($type == 1){ 104 if($type == 1){