作者 李宇航

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

Lyh server



查看合并请求 !2123
@@ -15,6 +15,7 @@ use App\Models\Channel\Channel; @@ -15,6 +15,7 @@ use App\Models\Channel\Channel;
15 use App\Models\Channel\User; 15 use App\Models\Channel\User;
16 use App\Models\Channel\Zone; 16 use App\Models\Channel\Zone;
17 use App\Models\Com\City; 17 use App\Models\Com\City;
  18 +use App\Models\Com\NoticeLog;
18 use App\Models\Com\UpdateLog; 19 use App\Models\Com\UpdateLog;
19 use App\Models\Devops\ServerConfig; 20 use App\Models\Devops\ServerConfig;
20 use App\Models\Devops\ServersIp; 21 use App\Models\Devops\ServersIp;
@@ -1229,4 +1230,20 @@ class ProjectController extends BaseController @@ -1229,4 +1230,20 @@ class ProjectController extends BaseController
1229 $this->response('success', Code::SUCCESS, $lists); 1230 $this->response('success', Code::SUCCESS, $lists);
1230 } 1231 }
1231 1232
  1233 + /**
  1234 + * @remark :生成关键词图表数据
  1235 + * @name :generateCountCharts
  1236 + * @author :lyh
  1237 + * @method :post
  1238 + * @time :2025/6/10 10:51
  1239 + */
  1240 + public function generateCountCharts(){
  1241 + $noticeModel = new NoticeLog();
  1242 + $info = $noticeModel->read(['type'=>NoticeLog::TYPE_GENERATE_COUNT_CHARTS,'status'=>0,'data'=>['like','%"'.$this->param['project_id'].'"%']]);
  1243 + if($info !== false){
  1244 + $this->fail('当前数据在生成中');
  1245 + }
  1246 + NoticeLog::createLog(NoticeLog::TYPE_GENERATE_COUNT_CHARTS, ['project_id' => $this->user['project_id']]);
  1247 + $this->response('success');
  1248 + }
1232 } 1249 }
@@ -81,7 +81,7 @@ class NewsLogic extends BaseLogic @@ -81,7 +81,7 @@ class NewsLogic extends BaseLogic
81 $this->edit(['url' => $route], ['id' => $id]); 81 $this->edit(['url' => $route], ['id' => $id]);
82 $this->curlDelRoute(['new_route'=>$route]); 82 $this->curlDelRoute(['new_route'=>$route]);
83 } 83 }
84 - $this->model->saveExtendInfo($id,$this->param['extend'] ?? []); 84 + $this->model->saveExtendInfo($id,$this->param['extend'] ?? [],$this->user['project_id']);
85 $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); 85 $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
86 return $this->success(['id'=>$id]); 86 return $this->success(['id'=>$id]);
87 } 87 }
@@ -14,6 +14,7 @@ class NoticeLog extends Base @@ -14,6 +14,7 @@ class NoticeLog extends Base
14 const TYPE_RANK_DATA = 'rank_data'; 14 const TYPE_RANK_DATA = 'rank_data';
15 const TYPE_INIT_PROJECT = 'init_project'; 15 const TYPE_INIT_PROJECT = 'init_project';
16 const TYPE_INIT_KEYWORD_COMMON = 'init_keyword_common';//聚合页关键词评论 16 const TYPE_INIT_KEYWORD_COMMON = 'init_keyword_common';//聚合页关键词评论
  17 + const TYPE_GENERATE_COUNT_CHARTS = 'generate_count_charts';//聚合页关键字图片生成
17 const TYPE_COPY_PROJECT = 'copy_project'; 18 const TYPE_COPY_PROJECT = 'copy_project';
18 const TYPE_INIT_KEYWORD = 'init_keyword'; 19 const TYPE_INIT_KEYWORD = 'init_keyword';
19 const DELETE_PRODUCT_CATEGORY = 'delete_product_category'; 20 const DELETE_PRODUCT_CATEGORY = 'delete_product_category';
@@ -109,7 +109,7 @@ class News extends Base @@ -109,7 +109,7 @@ class News extends Base
109 * @method :post 109 * @method :post
110 * @time :2023/11/9 15:02 110 * @time :2023/11/9 15:02
111 */ 111 */
112 - public function saveExtendInfo($news_id,$extend){ 112 + public function saveExtendInfo($news_id,$extend,$project_id){
113 //先删除以前的数据 113 //先删除以前的数据
114 $extendInfoModel = new NewsExtendInfo(); 114 $extendInfoModel = new NewsExtendInfo();
115 $extendInfoModel->del(['news_id'=>$news_id]); 115 $extendInfoModel->del(['news_id'=>$news_id]);
@@ -120,7 +120,7 @@ class News extends Base @@ -120,7 +120,7 @@ class News extends Base
120 if(empty($v['values'])){ 120 if(empty($v['values'])){
121 continue; 121 continue;
122 } 122 }
123 - $v = $this->saveHandleExtend($v,$news_id); 123 + $v = $this->saveHandleExtend($v,$news_id,$project_id);
124 $extendInfoModel->add($v); 124 $extendInfoModel->add($v);
125 } 125 }
126 return true; 126 return true;
@@ -133,7 +133,7 @@ class News extends Base @@ -133,7 +133,7 @@ class News extends Base
133 * @method :post 133 * @method :post
134 * @time :2023/12/6 15:11 134 * @time :2023/12/6 15:11
135 */ 135 */
136 - public function saveHandleExtend(&$v,$news_id){ 136 + public function saveHandleExtend(&$v,$news_id,$project_id){
137 unset($v['title']); 137 unset($v['title']);
138 if($v['type'] == 3){ 138 if($v['type'] == 3){
139 foreach ($v['values'] as $k1=>$v1){ 139 foreach ($v['values'] as $k1=>$v1){
@@ -148,7 +148,7 @@ class News extends Base @@ -148,7 +148,7 @@ class News extends Base
148 } 148 }
149 $v['values'] = json_encode($v['values']); 149 $v['values'] = json_encode($v['values']);
150 } 150 }
151 - $v['project_id'] = $this->user['project_id']; 151 + $v['project_id'] = $project_id;
152 $v['news_id'] = $news_id; 152 $v['news_id'] = $news_id;
153 return $v; 153 return $v;
154 } 154 }
@@ -209,6 +209,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -209,6 +209,7 @@ Route::middleware(['aloginauth'])->group(function () {
209 Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); 209 Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix');
210 Route::any('/save', [Aside\Project\KeywordPrefixController::class, 'save'])->name('admin.keyword_save'); 210 Route::any('/save', [Aside\Project\KeywordPrefixController::class, 'save'])->name('admin.keyword_save');
211 Route::any('/del', [Aside\Project\KeywordPrefixController::class, 'del'])->name('admin.keyword_del'); 211 Route::any('/del', [Aside\Project\KeywordPrefixController::class, 'del'])->name('admin.keyword_del');
  212 + Route::any('/generateCountCharts', [Aside\Project\ProjectController::class, 'generateCountCharts'])->name('admin.keyword_generateCountCharts');
212 }); 213 });
213 //企业资料库 214 //企业资料库
214 Route::prefix('enterprise_product')->group(function () { 215 Route::prefix('enterprise_product')->group(function () {