合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !1932
正在显示
5 个修改的文件
包含
50 行增加
和
8 行删除
| @@ -259,6 +259,7 @@ class AiVideoTask extends Command | @@ -259,6 +259,7 @@ class AiVideoTask extends Command | ||
| 259 | $aiVideoListModel = new AiVideoList(); | 259 | $aiVideoListModel = new AiVideoList(); |
| 260 | if(!empty($saveData)){ | 260 | if(!empty($saveData)){ |
| 261 | //写一条路由信息 | 261 | //写一条路由信息 |
| 262 | + RouteMap::setRoute('top-video',RouteMap::SOURCE_AI_VIDEO_LIST,0,$project_id);//写一条列表页路由 | ||
| 262 | $aiVideoListModel->truncate(); | 263 | $aiVideoListModel->truncate(); |
| 263 | $aiVideoListModel->insertAll($saveData); | 264 | $aiVideoListModel->insertAll($saveData); |
| 264 | } | 265 | } |
| @@ -13,6 +13,7 @@ use App\Enums\Common\Code; | @@ -13,6 +13,7 @@ use App\Enums\Common\Code; | ||
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Http\Logic\Bside\Ai\AiVideoLogic; | 14 | use App\Http\Logic\Bside\Ai\AiVideoLogic; |
| 15 | use App\Models\Ai\AiVideo; | 15 | use App\Models\Ai\AiVideo; |
| 16 | +use App\Models\Ai\AiVideoList; | ||
| 16 | 17 | ||
| 17 | class AiVideoController extends BaseController | 18 | class AiVideoController extends BaseController |
| 18 | { | 19 | { |
| @@ -109,4 +110,23 @@ class AiVideoController extends BaseController | @@ -109,4 +110,23 @@ class AiVideoController extends BaseController | ||
| 109 | $result = $aiVideoLogic->videoDelete(); | 110 | $result = $aiVideoLogic->videoDelete(); |
| 110 | $this->response('success',Code::SUCCESS,$result); | 111 | $this->response('success',Code::SUCCESS,$result); |
| 111 | } | 112 | } |
| 113 | + | ||
| 114 | + | ||
| 115 | + /** | ||
| 116 | + * @remark :获取列表页数据 | ||
| 117 | + * @name :getAiBlogList | ||
| 118 | + * @author :lyh | ||
| 119 | + * @method :post | ||
| 120 | + * @time :2025/2/21 16:22 | ||
| 121 | + */ | ||
| 122 | + public function getAiBlogList(AiVideoList $aiVideoList){ | ||
| 123 | + $lists = $aiVideoList->lists($this->map,$this->page,$this->row,'id',['id','route','created_at','updated_at']); | ||
| 124 | + if(!empty($lists) && !empty($lists['list'])){ | ||
| 125 | + foreach ($lists['list'] as $k => $v){ | ||
| 126 | + $v['route'] = $this->user['domain'] . 'top-video/' . (($v['route'] > 1) ? $v['route'] : ''); | ||
| 127 | + $lists['list'][$k] = $v; | ||
| 128 | + } | ||
| 129 | + } | ||
| 130 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 131 | + } | ||
| 112 | } | 132 | } |
| @@ -147,6 +147,10 @@ class ComController extends BaseController | @@ -147,6 +147,10 @@ class ComController extends BaseController | ||
| 147 | if($is_blogs != 1){ | 147 | if($is_blogs != 1){ |
| 148 | $info['role_menu'] = trim(str_replace(',57,',',',','.$info['role_menu'].','),','); | 148 | $info['role_menu'] = trim(str_replace(',57,',',',','.$info['role_menu'].','),','); |
| 149 | } | 149 | } |
| 150 | + $is_video = $this->getIsAiVideo(); | ||
| 151 | + if($is_video != 1){ | ||
| 152 | + $info['role_menu'] = trim(str_replace(',74,',',',','.$info['role_menu'].','),','); | ||
| 153 | + } | ||
| 150 | $this->map = [ | 154 | $this->map = [ |
| 151 | 'status'=>0, | 155 | 'status'=>0, |
| 152 | 'is_role'=>0, | 156 | 'is_role'=>0, |
| @@ -195,6 +199,10 @@ class ComController extends BaseController | @@ -195,6 +199,10 @@ class ComController extends BaseController | ||
| 195 | if($is_ai_blog != 1){ | 199 | if($is_ai_blog != 1){ |
| 196 | $data[] = 57; | 200 | $data[] = 57; |
| 197 | } | 201 | } |
| 202 | + $is_ai_video = $this->getIsAiVideo(); | ||
| 203 | + if($is_ai_video != 1){ | ||
| 204 | + $data[] = 74; | ||
| 205 | + } | ||
| 198 | if(!empty($data)){ | 206 | if(!empty($data)){ |
| 199 | $this->map['id'] = ['not in',$data]; | 207 | $this->map['id'] = ['not in',$data]; |
| 200 | } | 208 | } |
| @@ -291,6 +299,16 @@ class ComController extends BaseController | @@ -291,6 +299,16 @@ class ComController extends BaseController | ||
| 291 | return $this->user['is_ai_blog'] ?? 0; | 299 | return $this->user['is_ai_blog'] ?? 0; |
| 292 | } | 300 | } |
| 293 | 301 | ||
| 302 | + /** | ||
| 303 | + * @remark :ai视频 | ||
| 304 | + * @name :getIsAiVideo | ||
| 305 | + * @author :lyh | ||
| 306 | + * @method :post | ||
| 307 | + * @time :2025/5/6 14:33 | ||
| 308 | + */ | ||
| 309 | + public function getIsAiVideo(){ | ||
| 310 | + return $this->user['is_ai_video'] ?? 0; | ||
| 311 | + } | ||
| 294 | 312 | ||
| 295 | /** | 313 | /** |
| 296 | * @name :登录用户编辑资料/修改密码 | 314 | * @name :登录用户编辑资料/修改密码 |
| @@ -166,7 +166,7 @@ class ProjectLogic extends BaseLogic | @@ -166,7 +166,7 @@ class ProjectLogic extends BaseLogic | ||
| 166 | }else{ | 166 | }else{ |
| 167 | $this->param = $this->handleLevelStr($this->param);//处理星级客户暂停优化默认参数 | 167 | $this->param = $this->handleLevelStr($this->param);//处理星级客户暂停优化默认参数 |
| 168 | $this->saveSeoPlan($this->param);//保存seo白帽类型,上线保存一条审核记录 | 168 | $this->saveSeoPlan($this->param);//保存seo白帽类型,上线保存一条审核记录 |
| 169 | - $this->checkAiBlog($this->param);//开启白帽验证参数 | 169 | + $this->checkAiBlog($this->param);//开启ai相关功能验证参数 |
| 170 | DB::beginTransaction(); | 170 | DB::beginTransaction(); |
| 171 | try { | 171 | try { |
| 172 | //初始化项目 | 172 | //初始化项目 |
| @@ -174,8 +174,9 @@ class ProjectLogic extends BaseLogic | @@ -174,8 +174,9 @@ class ProjectLogic extends BaseLogic | ||
| 174 | //双向绑定服务器,需放到保存项目的上方 | 174 | //双向绑定服务器,需放到保存项目的上方 |
| 175 | $this->setServers($this->param['serve_id'],$this->param['id']); | 175 | $this->setServers($this->param['serve_id'],$this->param['id']); |
| 176 | //ai_blog | 176 | //ai_blog |
| 177 | - $this->setAiBlog($this->param['id'],$this->param['main_lang_id'],$this->param['is_ai_blog'], | ||
| 178 | - $this->param['company']??"", $this->param['deploy_optimize']['company_en_name'] ?? '',$this->param['deploy_optimize']['company_en_description'] ?? ''); | 177 | + $this->setAiBlog($this->param['id'],$this->param['main_lang_id'],$this->param['is_ai_blog'] ?? 0, |
| 178 | + $this->param['company']??"", $this->param['deploy_optimize']['company_en_name'] ?? '', | ||
| 179 | + $this->param['deploy_optimize']['company_en_description'] ?? '',$this->param['is_ai_video'] ?? 0); | ||
| 179 | //保存项目信息 | 180 | //保存项目信息 |
| 180 | $this->saveProject($this->param); | 181 | $this->saveProject($this->param); |
| 181 | //保存建站部署信息 | 182 | //保存建站部署信息 |
| @@ -217,6 +218,7 @@ class ProjectLogic extends BaseLogic | @@ -217,6 +218,7 @@ class ProjectLogic extends BaseLogic | ||
| 217 | if (in_array('2', $param['level']) || in_array('3', $param['level'])) { | 218 | if (in_array('2', $param['level']) || in_array('3', $param['level'])) { |
| 218 | //优化设置默认关闭 | 219 | //优化设置默认关闭 |
| 219 | $param['is_ai_blog'] = 0; | 220 | $param['is_ai_blog'] = 0; |
| 221 | + $param['is_ai_video'] = 0; | ||
| 220 | $param['deploy_optimize']['is_ai_blog_send'] = 0; | 222 | $param['deploy_optimize']['is_ai_blog_send'] = 0; |
| 221 | $param['deploy_optimize']['is_auto_keywords'] = 0; | 223 | $param['deploy_optimize']['is_auto_keywords'] = 0; |
| 222 | } | 224 | } |
| @@ -259,7 +261,7 @@ class ProjectLogic extends BaseLogic | @@ -259,7 +261,7 @@ class ProjectLogic extends BaseLogic | ||
| 259 | } | 261 | } |
| 260 | 262 | ||
| 261 | /** | 263 | /** |
| 262 | - * @remark :开启白帽验证参数 | 264 | + * @remark :开启ai博客及视频 |
| 263 | * @name :checkAiBlog | 265 | * @name :checkAiBlog |
| 264 | * @author :lyh | 266 | * @author :lyh |
| 265 | * @method :post | 267 | * @method :post |
| @@ -287,11 +289,11 @@ class ProjectLogic extends BaseLogic | @@ -287,11 +289,11 @@ class ProjectLogic extends BaseLogic | ||
| 287 | * @method :post | 289 | * @method :post |
| 288 | * @time :2025/2/13 16:02 | 290 | * @time :2025/2/13 16:02 |
| 289 | */ | 291 | */ |
| 290 | - public function setAiBlog($project_id,$main_lang_id,$is_ai_blog,$company,$company_en_name,$company_en_description){ | ||
| 291 | - if(empty($main_lang_id) || empty($is_ai_blog)){ | 292 | + public function setAiBlog($project_id,$main_lang_id,$is_ai_blog,$company,$company_en_name,$company_en_description,$is_ai_video = 0){ |
| 293 | + if(empty($main_lang_id) || (empty($is_ai_blog) && empty($is_ai_video))){ | ||
| 292 | return true; | 294 | return true; |
| 293 | } | 295 | } |
| 294 | - $projectInfo = $this->model->read(['id'=>$project_id],['title','is_ai_blog','main_lang_id','company']); | 296 | + $projectInfo = $this->model->read(['id'=>$project_id],['title','main_lang_id','company']); |
| 295 | $projectOptimize = DeployOptimize::where('project_id', $project_id)->first(); | 297 | $projectOptimize = DeployOptimize::where('project_id', $project_id)->first(); |
| 296 | //获取项目主语种 | 298 | //获取项目主语种 |
| 297 | $languageModel = new WebLanguage(); | 299 | $languageModel = new WebLanguage(); |
| @@ -274,7 +274,8 @@ class UserLoginLogic | @@ -274,7 +274,8 @@ class UserLoginLogic | ||
| 274 | $info['is_show_blog'] = $project['is_show_blog']; | 274 | $info['is_show_blog'] = $project['is_show_blog']; |
| 275 | $info['upload_config'] = $project['upload_config']; | 275 | $info['upload_config'] = $project['upload_config']; |
| 276 | $info['main_lang_id'] = $project['main_lang_id']; | 276 | $info['main_lang_id'] = $project['main_lang_id']; |
| 277 | - $info['is_ai_blog'] = $project['is_ai_blog']; | 277 | + $info['is_ai_blog'] = $project['is_ai_blog'] ?? 0; |
| 278 | + $info['is_ai_video'] = $project['is_ai_video'] ?? 0; | ||
| 278 | $info['image_max'] = $project['image_max']; | 279 | $info['image_max'] = $project['image_max']; |
| 279 | $info['is_del_inquiry'] = $project['is_del_inquiry'] ?? 0; | 280 | $info['is_del_inquiry'] = $project['is_del_inquiry'] ?? 0; |
| 280 | $info['uptime_type'] = $this->getHistory($project); | 281 | $info['uptime_type'] = $this->getHistory($project); |
-
请 注册 或 登录 后发表评论