作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -331,6 +331,7 @@ class ProjectUpdate extends Command @@ -331,6 +331,7 @@ class ProjectUpdate extends Command
331 'status' => Product::STATUS_ON, 331 'status' => Product::STATUS_ON,
332 'created_at' => $item['post_date'] ?? date('Y-m-d H:i:s'), 332 'created_at' => $item['post_date'] ?? date('Y-m-d H:i:s'),
333 'updated_at' => $item['post_date'] ?? date('Y-m-d H:i:s'), 333 'updated_at' => $item['post_date'] ?? date('Y-m-d H:i:s'),
  334 + 'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'),
334 'sort' => $item['sort'] ?? 0, 335 'sort' => $item['sort'] ?? 0,
335 'is_upgrade' => 1, 336 'is_upgrade' => 1,
336 'six_read' => 1, 337 'six_read' => 1,
@@ -357,6 +358,7 @@ class ProjectUpdate extends Command @@ -357,6 +358,7 @@ class ProjectUpdate extends Command
357 'keyword' => $item['keywords'] ?? '', 358 'keyword' => $item['keywords'] ?? '',
358 'description' => $item['description'] ?? '' 359 'description' => $item['description'] ?? ''
359 ]), 360 ]),
  361 + 'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'),
360 'sort' => $item['sort'] ?? 0, 362 'sort' => $item['sort'] ?? 0,
361 ], ['id' => $id]); 363 ], ['id' => $id]);
362 } 364 }
@@ -469,6 +471,7 @@ class ProjectUpdate extends Command @@ -469,6 +471,7 @@ class ProjectUpdate extends Command
469 'status' => $api_type == 'news' ? News::STATUS_ONE : Blog::STATUS_ONE, 471 'status' => $api_type == 'news' ? News::STATUS_ONE : Blog::STATUS_ONE,
470 'created_at' => $item['post_date'] ?? date('Y-m-d H:i:s'), 472 'created_at' => $item['post_date'] ?? date('Y-m-d H:i:s'),
471 'updated_at' => $item['post_date'] ?? date('Y-m-d H:i:s'), 473 'updated_at' => $item['post_date'] ?? date('Y-m-d H:i:s'),
  474 + 'release_at' => $item['post_date'] ?? date('Y-m-d H:i:s'),
472 'sort' => $item['sort'] ?? 0, 475 'sort' => $item['sort'] ?? 0,
473 'is_upgrade' => 1, 476 'is_upgrade' => 1,
474 'six_read' => 1, 477 'six_read' => 1,
@@ -490,6 +493,7 @@ class ProjectUpdate extends Command @@ -490,6 +493,7 @@ class ProjectUpdate extends Command
490 'seo_description' => $item['description'] ?? '', 493 'seo_description' => $item['description'] ?? '',
491 'text' => $item['content'] ?? '', 494 'text' => $item['content'] ?? '',
492 'image' => $new_img, 495 'image' => $new_img,
  496 + 'release_at' => $item['post_date'] ?? date('Y-m-d H:i:s'),
493 'sort' => $item['sort'] ?? 0, 497 'sort' => $item['sort'] ?? 0,
494 ], ['id' => $id]); 498 ], ['id' => $id]);
495 } 499 }
@@ -659,6 +663,7 @@ class ProjectUpdate extends Command @@ -659,6 +663,7 @@ class ProjectUpdate extends Command
659 'image' => $new_img, 663 'image' => $new_img,
660 'created_at' => $item['post_time'] ?? date('Y-m-d H:i:s'), 664 'created_at' => $item['post_time'] ?? date('Y-m-d H:i:s'),
661 'updated_at' => $item['post_time'] ?? date('Y-m-d H:i:s'), 665 'updated_at' => $item['post_time'] ?? date('Y-m-d H:i:s'),
  666 + 'release_at' => $item['post_time'] ?? date('Y-m-d H:i:s'),
662 'is_upgrade' => 1, 667 'is_upgrade' => 1,
663 'six_read' => 1, 668 'six_read' => 1,
664 'route' => $route 669 'route' => $route
@@ -676,6 +681,7 @@ class ProjectUpdate extends Command @@ -676,6 +681,7 @@ class ProjectUpdate extends Command
676 'category_id' => $category_id, 681 'category_id' => $category_id,
677 'content' => $item['content'] ?? '', 682 'content' => $item['content'] ?? '',
678 'sort' => $item['sort'] ?? 0, 683 'sort' => $item['sort'] ?? 0,
  684 + 'release_at' => $item['post_time'] ?? date('Y-m-d H:i:s'),
679 'image' => $new_img 685 'image' => $new_img
680 ], ['id' => $id]); 686 ], ['id' => $id]);
681 } 687 }
@@ -330,4 +330,15 @@ class NewsController extends BaseController @@ -330,4 +330,15 @@ class NewsController extends BaseController
330 $lists = $news->list($this->map); 330 $lists = $news->list($this->map);
331 $this->response('success',Code::SUCCESS,$lists); 331 $this->response('success',Code::SUCCESS,$lists);
332 } 332 }
  333 +
  334 + /**
  335 + * @remark :复制新闻
  336 + * @name :copyNews
  337 + * @author :lyh
  338 + * @method :post
  339 + * @time :2024/4/28 11:53
  340 + */
  341 + public function copyNews(NewsModel $news){
  342 +
  343 + }
333 } 344 }
@@ -166,9 +166,10 @@ class FileController @@ -166,9 +166,10 @@ class FileController
166 public function getOnlyFilename($name,$project_id = 0){ 166 public function getOnlyFilename($name,$project_id = 0){
167 $nameArr = explode('.',$name); 167 $nameArr = explode('.',$name);
168 $enName = generateRoute(Translate::tran($nameArr[0], 'en')); 168 $enName = generateRoute(Translate::tran($nameArr[0], 'en'));
  169 + $fileName = $enName;
169 $i=1; 170 $i=1;
170 while($this->onlyName($enName.'.'.$nameArr[1],$project_id)){ 171 while($this->onlyName($enName.'.'.$nameArr[1],$project_id)){
171 - $enName = $enName .'-'.$i; 172 + $enName = $fileName .'_'.$i;
172 $i++; 173 $i++;
173 } 174 }
174 return $enName.'.'.$nameArr[1]; 175 return $enName.'.'.$nameArr[1];
@@ -226,9 +226,10 @@ class ImageController extends Controller @@ -226,9 +226,10 @@ class ImageController extends Controller
226 public function getOnlyFilename($name,$project_id = 0){ 226 public function getOnlyFilename($name,$project_id = 0){
227 $nameArr = explode('.',$name); 227 $nameArr = explode('.',$name);
228 $enName = generateRoute(Translate::tran($nameArr[0], 'en')); 228 $enName = generateRoute(Translate::tran($nameArr[0], 'en'));
  229 + $fileName = $enName;
229 $i=1; 230 $i=1;
230 while($this->onlyName($enName.'.'.$nameArr[1],$project_id)){ 231 while($this->onlyName($enName.'.'.$nameArr[1],$project_id)){
231 - $enName = $enName .'-'.$i; 232 + $enName = $fileName .'_'.$i;
232 $i++; 233 $i++;
233 } 234 }
234 return $enName.'.'.$nameArr[1]; 235 return $enName.'.'.$nameArr[1];