作者 lyh

gx脚本更新路由

@@ -80,11 +80,13 @@ class UpdateBuildConfiguration extends Command @@ -80,11 +80,13 @@ class UpdateBuildConfiguration extends Command
80 */ 80 */
81 public function getProduct(){ 81 public function getProduct(){
82 $productModel = new Product(); 82 $productModel = new Product();
83 - $lists = $productModel->list(); 83 + $lists = $productModel->list([],'id',['id','content']);
84 $detailModel = new Detail(); 84 $detailModel = new Detail();
85 if(!empty($lists)){ 85 if(!empty($lists)){
86 foreach ($lists as $k => $v){ 86 foreach ($lists as $k => $v){
87 echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL; 87 echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;
  88 + $info = $detailModel->read(['product_id'=>$v['id']],['id']);
  89 + if($info === false){
88 $data = [ 90 $data = [
89 'product_id'=>$v['id'], 91 'product_id'=>$v['id'],
90 'column_id'=>1, 92 'column_id'=>1,
@@ -98,6 +100,7 @@ class UpdateBuildConfiguration extends Command @@ -98,6 +100,7 @@ class UpdateBuildConfiguration extends Command
98 $detailModel->insert($data); 100 $detailModel->insert($data);
99 } 101 }
100 } 102 }
  103 + }
101 return true; 104 return true;
102 } 105 }
103 106