Merge remote-tracking branch 'origin/master' into akun
正在显示
12 个修改的文件
包含
53 行增加
和
19 行删除
| @@ -75,6 +75,7 @@ class CopyProject extends Command | @@ -75,6 +75,7 @@ class CopyProject extends Command | ||
| 75 | }catch (\Exception $e){ | 75 | }catch (\Exception $e){ |
| 76 | echo $e->getMessage().PHP_EOL; | 76 | echo $e->getMessage().PHP_EOL; |
| 77 | echo '复制数据库失败:'.$old_project_id . '<->'.$project_id; | 77 | echo '复制数据库失败:'.$old_project_id . '<->'.$project_id; |
| 78 | + continue; | ||
| 78 | } | 79 | } |
| 79 | //修改项目状态 | 80 | //修改项目状态 |
| 80 | $projectModel->edit(['delete_status'=>0],['id'=>$project_id]); | 81 | $projectModel->edit(['delete_status'=>0],['id'=>$project_id]); |
| @@ -52,6 +52,7 @@ class PrivateController extends BaseController | @@ -52,6 +52,7 @@ class PrivateController extends BaseController | ||
| 52 | ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') | 52 | ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') |
| 53 | ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') | 53 | ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') |
| 54 | ->where('gl_project.type', Project::TYPE_TWO) | 54 | ->where('gl_project.type', Project::TYPE_TWO) |
| 55 | + ->where('gl_project,project_type',Project::TYPE_ZERO) | ||
| 55 | ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 | 56 | ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 |
| 56 | ->where('gl_project.delete_status', Project::IS_DEL_FALSE) | 57 | ->where('gl_project.delete_status', Project::IS_DEL_FALSE) |
| 57 | ->where(function ($subQuery) { | 58 | ->where(function ($subQuery) { |
| @@ -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; |
| @@ -960,14 +961,10 @@ class ProjectController extends BaseController | @@ -960,14 +961,10 @@ class ProjectController extends BaseController | ||
| 960 | 'id'=>'required', | 961 | 'id'=>'required', |
| 961 | 'aicc'=>'required', | 962 | 'aicc'=>'required', |
| 962 | 'hagro'=>'required', | 963 | 'hagro'=>'required', |
| 963 | -// 'exclusive_aicc_day'=>'required', | ||
| 964 | -// 'exclusive_hagro_day'=>'required', | ||
| 965 | ],[ | 964 | ],[ |
| 966 | 'id.required' => 'id不能为空', | 965 | 'id.required' => 'id不能为空', |
| 967 | 'aicc.required' => 'aicc是否开启不能为空', | 966 | 'aicc.required' => 'aicc是否开启不能为空', |
| 968 | 'hagro.required' => 'hagro是否开启不能为空', | 967 | 'hagro.required' => 'hagro是否开启不能为空', |
| 969 | -// 'exclusive_aicc_day.required' => '服务天数不能为空', | ||
| 970 | -// 'exclusive_hagro_day.required' => '服务天数不能为空', | ||
| 971 | ]); | 968 | ]); |
| 972 | $logic->saveOtherProject(); | 969 | $logic->saveOtherProject(); |
| 973 | $this->response('success'); | 970 | $this->response('success'); |
| @@ -1229,4 +1226,25 @@ class ProjectController extends BaseController | @@ -1229,4 +1226,25 @@ class ProjectController extends BaseController | ||
| 1229 | $this->response('success', Code::SUCCESS, $lists); | 1226 | $this->response('success', Code::SUCCESS, $lists); |
| 1230 | } | 1227 | } |
| 1231 | 1228 | ||
| 1229 | + /** | ||
| 1230 | + * @remark :生成关键词图表数据 | ||
| 1231 | + * @name :generateCountCharts | ||
| 1232 | + * @author :lyh | ||
| 1233 | + * @method :post | ||
| 1234 | + * @time :2025/6/10 10:51 | ||
| 1235 | + */ | ||
| 1236 | + public function generateCountCharts(){ | ||
| 1237 | + $this->request->validate([ | ||
| 1238 | + 'project_id'=>'required', | ||
| 1239 | + ],[ | ||
| 1240 | + 'project_id.required' => '项目id不能为空', | ||
| 1241 | + ]); | ||
| 1242 | + $noticeModel = new NoticeLog(); | ||
| 1243 | + $info = $noticeModel->read(['type'=>NoticeLog::TYPE_GENERATE_COUNT_CHARTS,'status'=>0,'data'=>['like','%"'.$this->param['project_id'].'"%']]); | ||
| 1244 | + if($info !== false){ | ||
| 1245 | + $this->fail('当前数据在生成中'); | ||
| 1246 | + } | ||
| 1247 | + NoticeLog::createLog(NoticeLog::TYPE_GENERATE_COUNT_CHARTS, ['project_id' => $this->param['project_id']]); | ||
| 1248 | + $this->response('success'); | ||
| 1249 | + } | ||
| 1232 | } | 1250 | } |
| @@ -328,9 +328,11 @@ class KeywordController extends BaseController | @@ -328,9 +328,11 @@ class KeywordController extends BaseController | ||
| 328 | $this->request->validate([ | 328 | $this->request->validate([ |
| 329 | 'text'=>'required', | 329 | 'text'=>'required', |
| 330 | 'nickname'=>'required', | 330 | 'nickname'=>'required', |
| 331 | + 'start_time'=>'required', | ||
| 331 | ],[ | 332 | ],[ |
| 332 | 'text.required' => '评论内容不能为空', | 333 | 'text.required' => '评论内容不能为空', |
| 333 | 'nickname.required'=>'昵称不能为空', | 334 | 'nickname.required'=>'昵称不能为空', |
| 335 | + 'start_time.required'=>'发布时间不能为空', | ||
| 334 | ]); | 336 | ]); |
| 335 | $data = $logic->saveComment(); | 337 | $data = $logic->saveComment(); |
| 336 | $this->response('success',Code::SUCCESS,$data); | 338 | $this->response('success',Code::SUCCESS,$data); |
| @@ -23,7 +23,7 @@ class WebSettingImageController extends BaseController | @@ -23,7 +23,7 @@ class WebSettingImageController extends BaseController | ||
| 23 | * @time :2023/9/21 15:12 | 23 | * @time :2023/9/21 15:12 |
| 24 | */ | 24 | */ |
| 25 | public function lists(WebSettingImage $webSettingImage){ | 25 | public function lists(WebSettingImage $webSettingImage){ |
| 26 | - $list = $webSettingImage->list($this->map,'id',['id','image','type']); | 26 | + $list = $webSettingImage->list($this->map,'id',['id','image','type','is_call']); |
| 27 | foreach ($list as $k=>$v){ | 27 | foreach ($list as $k=>$v){ |
| 28 | $v['image'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); | 28 | $v['image'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); |
| 29 | $list[$k] = $v; | 29 | $list[$k] = $v; |
| @@ -40,12 +40,16 @@ class WebSettingImageController extends BaseController | @@ -40,12 +40,16 @@ class WebSettingImageController extends BaseController | ||
| 40 | */ | 40 | */ |
| 41 | public function save(WebSettingImage $webSettingImage){ | 41 | public function save(WebSettingImage $webSettingImage){ |
| 42 | try { | 42 | try { |
| 43 | - $webSettingImage->del(['project_id'=>$this->user['project_id']]); | ||
| 44 | foreach ($this->param['data'] as $v){ | 43 | foreach ($this->param['data'] as $v){ |
| 44 | + if(isset($v['id']) && !empty($v['id'])){ | ||
| 45 | + $v['image'] = str_replace_url($v['image']); | ||
| 46 | + $webSettingImage->edit($v,['id'=>$v['id']]); | ||
| 47 | + }else{ | ||
| 45 | $v['project_id'] = $this->user['project_id']; | 48 | $v['project_id'] = $this->user['project_id']; |
| 46 | $v['image'] = str_replace_url($v['image']); | 49 | $v['image'] = str_replace_url($v['image']); |
| 47 | $webSettingImage->add($v); | 50 | $webSettingImage->add($v); |
| 48 | } | 51 | } |
| 52 | + } | ||
| 49 | }catch (\Exception $e){ | 53 | }catch (\Exception $e){ |
| 50 | $this->response('系统错误请联系管理员'); | 54 | $this->response('系统错误请联系管理员'); |
| 51 | } | 55 | } |
| @@ -9,7 +9,6 @@ | @@ -9,7 +9,6 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Http\Logic\Bside\Gpt; | 10 | namespace App\Http\Logic\Bside\Gpt; |
| 11 | 11 | ||
| 12 | -use App\Helper\Stream; | ||
| 13 | use App\Http\Logic\Bside\BaseLogic; | 12 | use App\Http\Logic\Bside\BaseLogic; |
| 14 | use App\Models\Gpt\Chat; | 13 | use App\Models\Gpt\Chat; |
| 15 | use App\Models\Gpt\ChatItem; | 14 | use App\Models\Gpt\ChatItem; |
| @@ -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 | } |
| @@ -367,6 +367,7 @@ class KeywordLogic extends BaseLogic | @@ -367,6 +367,7 @@ class KeywordLogic extends BaseLogic | ||
| 367 | 'project_id' => $this->user['project_id'], | 367 | 'project_id' => $this->user['project_id'], |
| 368 | 'type' => 1, | 368 | 'type' => 1, |
| 369 | 'uid' => 0, | 369 | 'uid' => 0, |
| 370 | + 'start_time'=>$this->param['start_time'], | ||
| 370 | 'created_at' => date('Y-m-d H:i:s'), | 371 | 'created_at' => date('Y-m-d H:i:s'), |
| 371 | 'updated_at' => date('Y-m-d H:i:s') | 372 | 'updated_at' => date('Y-m-d H:i:s') |
| 372 | ]; | 373 | ]; |
| @@ -394,6 +395,8 @@ class KeywordLogic extends BaseLogic | @@ -394,6 +395,8 @@ class KeywordLogic extends BaseLogic | ||
| 394 | $text = Common::deal_keywords($text); | 395 | $text = Common::deal_keywords($text); |
| 395 | preg_match_all('/\{[^{}]*\}/', $text, $matches); | 396 | preg_match_all('/\{[^{}]*\}/', $text, $matches); |
| 396 | $data = []; | 397 | $data = []; |
| 398 | + $twoMonthsAgo = strtotime('-2 months'); | ||
| 399 | + | ||
| 397 | if (!empty($text)) { | 400 | if (!empty($text)) { |
| 398 | foreach ($matches[0] as $item) { | 401 | foreach ($matches[0] as $item) { |
| 399 | $item = str_replace("'", '"', $item); | 402 | $item = str_replace("'", '"', $item); |
| @@ -402,12 +405,15 @@ class KeywordLogic extends BaseLogic | @@ -402,12 +405,15 @@ class KeywordLogic extends BaseLogic | ||
| 402 | if (!isset($item['name']) || !isset($item['comment'])) { | 405 | if (!isset($item['name']) || !isset($item['comment'])) { |
| 403 | continue; | 406 | continue; |
| 404 | } | 407 | } |
| 408 | + $randomTimestamp = rand($twoMonthsAgo, time()); | ||
| 409 | + $randomDateTime = date('Y-m-d H:i:s', $randomTimestamp); | ||
| 405 | $data[] = [ | 410 | $data[] = [ |
| 406 | 'nickname' => $item['name'], | 411 | 'nickname' => $item['name'], |
| 407 | 'text' => $item['comment'], | 412 | 'text' => $item['comment'], |
| 408 | 'project_id' => $this->user['project_id'], | 413 | 'project_id' => $this->user['project_id'], |
| 409 | 'type' => 1, | 414 | 'type' => 1, |
| 410 | 'uid' => 0, | 415 | 'uid' => 0, |
| 416 | + 'start_time'=>$randomDateTime, | ||
| 411 | 'created_at' => date('Y-m-d H:i:s'), | 417 | 'created_at' => date('Y-m-d H:i:s'), |
| 412 | 'updated_at' => date('Y-m-d H:i:s') | 418 | 'updated_at' => date('Y-m-d H:i:s') |
| 413 | ]; | 419 | ]; |
| @@ -441,11 +447,11 @@ class KeywordLogic extends BaseLogic | @@ -441,11 +447,11 @@ class KeywordLogic extends BaseLogic | ||
| 441 | */ | 447 | */ |
| 442 | public function delComment(){ | 448 | public function delComment(){ |
| 443 | $keywordCommonModel = new AggregateKeywordComment(); | 449 | $keywordCommonModel = new AggregateKeywordComment(); |
| 444 | - if($this->param['id'] = 0){ | ||
| 445 | - $keywordCommonModel->del(['project_id'=>$this->param['project_id']]); | 450 | + if($this->param['id'] == 0){ |
| 451 | + $keywordCommonModel->del(['project_id'=>$this->user['project_id']]); | ||
| 446 | }else{ | 452 | }else{ |
| 447 | - $rs = $keywordCommonModel->del(['id'=>$this->param['id']]); | 453 | + $keywordCommonModel->del(['id'=>$this->param['id']]); |
| 448 | } | 454 | } |
| 449 | - return $this->success($rs); | 455 | + return $this->success(); |
| 450 | } | 456 | } |
| 451 | } | 457 | } |
| @@ -101,6 +101,7 @@ class RankDataLogic extends BaseLogic | @@ -101,6 +101,7 @@ class RankDataLogic extends BaseLogic | ||
| 101 | 'keyword_num' => $project['deploy_build']['keyword_num'], | 101 | 'keyword_num' => $project['deploy_build']['keyword_num'], |
| 102 | 'compliance_day' => $project['finish_remain_day'] ?? 0, | 102 | 'compliance_day' => $project['finish_remain_day'] ?? 0, |
| 103 | 'remain_day' => $project['remain_day'], | 103 | 'remain_day' => $project['remain_day'], |
| 104 | + 'seo_remain_day' => $project['seo_remain_day'], | ||
| 104 | 'g_top_plan' => $g_top_plan ?? [], | 105 | 'g_top_plan' => $g_top_plan ?? [], |
| 105 | ]; | 106 | ]; |
| 106 | //小语种列表 | 107 | //小语种列表 |
| @@ -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'; |
| @@ -80,7 +80,7 @@ class News extends Base | @@ -80,7 +80,7 @@ class News extends Base | ||
| 80 | $arr = json_decode($info['values']); | 80 | $arr = json_decode($info['values']); |
| 81 | foreach ($arr as $k1=>$v1){ | 81 | foreach ($arr as $k1=>$v1){ |
| 82 | $v1 = (array)$v1; | 82 | $v1 = (array)$v1; |
| 83 | - $v1['url'] = getImageUrl($v1['url'],$this->user['storage_type'],$this->user['project_location']); | 83 | + $v1['url'] = getImageUrl($v1['url']); |
| 84 | $arr[$k1] = $v1; | 84 | $arr[$k1] = $v1; |
| 85 | } | 85 | } |
| 86 | $v['values'] = $arr; | 86 | $v['values'] = $arr; |
| @@ -89,9 +89,9 @@ class News extends Base | @@ -89,9 +89,9 @@ class News extends Base | ||
| 89 | foreach ($arr1 as $k1=>$v1){ | 89 | foreach ($arr1 as $k1=>$v1){ |
| 90 | $v1 = (array)$v1; | 90 | $v1 = (array)$v1; |
| 91 | if(isset($v1['url'])){ | 91 | if(isset($v1['url'])){ |
| 92 | - $v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0); | 92 | + $v1['url'] = getFileUrl($v1['url']); |
| 93 | }else{ | 93 | }else{ |
| 94 | - $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0); | 94 | + $v1 = getFileUrl($v1); |
| 95 | } | 95 | } |
| 96 | $arr1[$k1] = $v1; | 96 | $arr1[$k1] = $v1; |
| 97 | } | 97 | } |
| @@ -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 () { |
-
请 注册 或 登录 后发表评论