作者 lyh

gxxiaoxie

@@ -56,12 +56,12 @@ class UpdateRoute extends Command @@ -56,12 +56,12 @@ class UpdateRoute extends Command
56 */ 56 */
57 public function handle(){ 57 public function handle(){
58 $projectModel = new Project(); 58 $projectModel = new Project();
59 - $list = $projectModel->list(['id'=>['in',[1417]]]); 59 + $list = $projectModel->list(['id'=>['in',[1750]]]);
60 $data = []; 60 $data = [];
61 foreach ($list as $v){ 61 foreach ($list as $v){
62 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 62 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
63 ProjectServer::useProject($v['id']); 63 ProjectServer::useProject($v['id']);
64 - $this->getProduct(); 64 +// $this->getProduct();
65 // $this->setProductKeyword(); 65 // $this->setProductKeyword();
66 // $this->getBlog(); 66 // $this->getBlog();
67 // $this->setCustomRoute($v['id']); 67 // $this->setCustomRoute($v['id']);
@@ -71,6 +71,40 @@ class UpdateRoute extends Command @@ -71,6 +71,40 @@ class UpdateRoute extends Command
71 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 71 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
72 } 72 }
73 73
  74 + /**
  75 + * @remark :同步擴展模塊數據到blogs
  76 + * @name :custom_to_blogs
  77 + * @author :lyh
  78 + * @method :post
  79 + * @time :2024/10/28 15:45
  80 + */
  81 + public function custom_to_blogs(){
  82 + $customContentModel = new CustomModuleContent();
  83 + $lists = $customContentModel->list(['module_id'=>9]);
  84 + foreach ($lists as $k => $v){
  85 + $data = [
  86 + 'name'=>$v['name'],
  87 + 'category_id'=>',1,',
  88 + 'remark'=>$v['remark'],
  89 + 'text'=>$v['content'],
  90 + 'url'=>$v['route'],
  91 + 'image'=>$v['image'],
  92 + 'seo_title'=>$v['seo_title'],
  93 + 'seo_description'=>$v['seo_description'],
  94 + 'seo_keywords'=>$v['seo_keywords'],
  95 + 'project_id'=>1750,
  96 + 'operator_id'=>$v['operator_id'],
  97 + 'create_id'=>$v['operator_id'],
  98 + 'created_at'=>$v['created_at'],
  99 + 'updated_at'=>$v['updated_at'],
  100 + 'release_at'=>$v['release_at']
  101 + ];
  102 + $blogModel = new Blog();
  103 + $id = $blogModel->insertGetId($data);
  104 + $route = RouteMap::setRoute($v['route'], RouteMap::SOURCE_MODULE, $id, 1750);
  105 + }
  106 + }
  107 +
74 public function editProductAlt(){ 108 public function editProductAlt(){
75 $productModel = new Product(); 109 $productModel = new Product();
76 $lists = $productModel->list(['status'=>1],'id',['id','route','thumb','gallery']); 110 $lists = $productModel->list(['status'=>1],'id',['id','route','thumb','gallery']);
@@ -145,7 +145,7 @@ class KeywordLogic extends BaseLogic @@ -145,7 +145,7 @@ class KeywordLogic extends BaseLogic
145 $keywordModel = new Keyword(); 145 $keywordModel = new Keyword();
146 $firstNumWord = $keywordModel->firstNumWord; 146 $firstNumWord = $keywordModel->firstNumWord;
147 foreach($firstNumWord as $k => $v){ 147 foreach($firstNumWord as $k => $v){
148 - if($v == $first_title){ 148 + if(strtolower($v) == strtolower($first_title)){
149 return $k; 149 return $k;
150 } 150 }
151 } 151 }