作者 lyh

gx数据

@@ -66,16 +66,32 @@ class Demo extends Command @@ -66,16 +66,32 @@ class Demo extends Command
66 protected $description = 'demo'; 66 protected $description = 'demo';
67 67
68 public function handle(){ 68 public function handle(){
69 -  
70 echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL; 69 echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL;
71 - ProjectServer::useProject(2837);  
72 - $this->ceshi(); 70 + ProjectServer::useProject(3092);
  71 + $this->delProduct();
73 DB::disconnect('custom_mysql'); 72 DB::disconnect('custom_mysql');
74 -// $this->countTemplate();  
75 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 73 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
76 } 74 }
77 75
78 /** 76 /**
  77 + * @remark :删除product
  78 + * @name :delProduct
  79 + * @author :lyh
  80 + * @method :post
  81 + * @time :2025/1/10 9:35
  82 + */
  83 + public function delProduct(){
  84 + $productModel = new Product();
  85 + $list = $productModel->list(['status'=>2]);
  86 + foreach ($list as $k => $v){
  87 + $routeModel = new RouteMap();
  88 + $routeModel->del(['source'=>'product','source_id'=>$v['id']]);
  89 + }
  90 + $productModel->del(['status'=>2]);
  91 + return true;
  92 + }
  93 +
  94 + /**
79 * @remark :统计当前模版使用情况 95 * @remark :统计当前模版使用情况
80 * @name :countTemplate 96 * @name :countTemplate
81 * @author :lyh 97 * @author :lyh