作者 李宇航

合并分支 'master-server' 到 'master'

gx脚本更新路由



查看合并请求 !962
@@ -82,18 +82,23 @@ class UpdateBuildConfiguration extends Command @@ -82,18 +82,23 @@ class UpdateBuildConfiguration extends Command
82 $productModel = new Product(); 82 $productModel = new Product();
83 $lists = $productModel->list(); 83 $lists = $productModel->list();
84 $detailModel = new Detail(); 84 $detailModel = new Detail();
85 - foreach ($lists as $k => $v){  
86 - echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;  
87 - $data = [  
88 - 'product_id'=>$v['id'],  
89 - 'column_id'=>1,  
90 - 'text_type'=>1,  
91 - 'title'=>'',  
92 - 'sort'=>1,  
93 - 'content'=>$v['describe']  
94 - ];  
95 - $detailModel->add($data); 85 + if(!empty($lists)){
  86 + foreach ($lists as $k => $v){
  87 + echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;
  88 + $data = [
  89 + 'product_id'=>$v['id'],
  90 + 'column_id'=>1,
  91 + 'text_type'=>1,
  92 + 'title'=>'',
  93 + 'sort'=>1,
  94 + 'content'=>$v['describe'],
  95 + 'created_at'=>date('Y-m-d H:i:s'),
  96 + 'updated_at'=>date('Y-m-d H:i:s')
  97 + ];
  98 + $detailModel->insert($data);
  99 + }
96 } 100 }
  101 + return true;
97 } 102 }
98 103
99 } 104 }