正在显示
5 个修改的文件
包含
34 行增加
和
4 行删除
| @@ -88,6 +88,9 @@ class VideoTask extends Command | @@ -88,6 +88,9 @@ class VideoTask extends Command | ||
| 88 | continue; | 88 | continue; |
| 89 | } | 89 | } |
| 90 | ProjectServer::useProject($task_project->project_id); | 90 | ProjectServer::useProject($task_project->project_id); |
| 91 | + if(!empty($task_project->keywords)){ | ||
| 92 | + $task_project->keywords = explode(',',trim(',',$task_project->keywords)); | ||
| 93 | + } | ||
| 91 | $keyword = $this->getProjectKeyword($task_project->number,$task_project->keywords); | 94 | $keyword = $this->getProjectKeyword($task_project->number,$task_project->keywords); |
| 92 | // 已经没有需要生成视频的关键词 | 95 | // 已经没有需要生成视频的关键词 |
| 93 | if (!$keyword) { | 96 | if (!$keyword) { |
| @@ -174,17 +177,19 @@ class VideoTask extends Command | @@ -174,17 +177,19 @@ class VideoTask extends Command | ||
| 174 | public function getProjectKeyword($number,$keywords = []) | 177 | public function getProjectKeyword($number,$keywords = []) |
| 175 | { | 178 | { |
| 176 | if(!empty($keywords)){ | 179 | if(!empty($keywords)){ |
| 177 | - $keyword_id = Keyword::where('video', null)->whereIn("title", $keywords)->where('route', 'not like', '%-tag')->whereNotNull('keyword_content')->pluck('id')->toArray(); | 180 | + $keyword_id = Keyword::where('video', null)->whereIn("title", $keywords) |
| 181 | + ->where('route', 'not like', '%-tag')->whereNotNull('keyword_content')->pluck('id')->toArray(); | ||
| 178 | if(count($keyword_id) == 0){ | 182 | if(count($keyword_id) == 0){ |
| 179 | $keyword_arr_id = Keyword::where('video', null)->where('route', 'not like', '%-tag') | 183 | $keyword_arr_id = Keyword::where('video', null)->where('route', 'not like', '%-tag') |
| 180 | ->whereNotNull('keyword_content')->orderBy('id','asc')->limit($number)->pluck('id')->toArray(); | 184 | ->whereNotNull('keyword_content')->orderBy('id','asc')->limit($number)->pluck('id')->toArray(); |
| 181 | }else{ | 185 | }else{ |
| 182 | - $keyword_arr_id = Keyword::where('video', null)->whereNotIn("title", $keywords)->where('route', 'not like', '%-tag')->whereNotNull('keyword_content') | ||
| 183 | - ->orderBy('id','asc')->limit($number - count($keyword_id))->pluck('id')->toArray(); | 186 | + $keyword_arr_id = Keyword::where('video', null)->whereNotIn("title", $keywords)->where('route', 'not like', '%-tag') |
| 187 | + ->whereNotNull('keyword_content')->orderBy('id','asc')->limit($number - count($keyword_id))->pluck('id')->toArray(); | ||
| 184 | $keyword_arr_id = array_merge($keyword_id,$keyword_arr_id); | 188 | $keyword_arr_id = array_merge($keyword_id,$keyword_arr_id); |
| 185 | } | 189 | } |
| 186 | }else{ | 190 | }else{ |
| 187 | - $keyword_arr_id = Keyword::where('video', null)->where('route', 'not like', '%-tag')->whereNotNull('keyword_content')->orderBy('id','asc')->limit($number)->pluck('id')->toArray(); | 191 | + $keyword_arr_id = Keyword::where('video', null)->where('route', 'not like', '%-tag') |
| 192 | + ->whereNotNull('keyword_content')->orderBy('id','asc')->limit($number)->pluck('id')->toArray(); | ||
| 188 | } | 193 | } |
| 189 | if(count($keyword_arr_id) == 0){ | 194 | if(count($keyword_arr_id) == 0){ |
| 190 | return []; | 195 | return []; |
| @@ -100,6 +100,7 @@ class NoticeController extends BaseController | @@ -100,6 +100,7 @@ class NoticeController extends BaseController | ||
| 100 | $keyword->video = $video; | 100 | $keyword->video = $video; |
| 101 | $keyword->embed_code = $embed_code; | 101 | $keyword->embed_code = $embed_code; |
| 102 | $keyword->video_thumb = $thumb; | 102 | $keyword->video_thumb = $thumb; |
| 103 | + $keyword->is_video_keyword = 1; | ||
| 103 | $keyword->save(); | 104 | $keyword->save(); |
| 104 | DB::disconnect('custom_mysql'); | 105 | DB::disconnect('custom_mysql'); |
| 105 | return 200; | 106 | return 200; |
| @@ -201,4 +201,26 @@ class KeywordController extends BaseController | @@ -201,4 +201,26 @@ class KeywordController extends BaseController | ||
| 201 | } | 201 | } |
| 202 | $this->response('success'); | 202 | $this->response('success'); |
| 203 | } | 203 | } |
| 204 | + | ||
| 205 | + /** | ||
| 206 | + * @remark :批量操作关键字是否展示视频 | ||
| 207 | + * @name :batchKeywordIsVideo | ||
| 208 | + * @author :lyh | ||
| 209 | + * @method :post | ||
| 210 | + * @time :2024/5/30 14:29 | ||
| 211 | + */ | ||
| 212 | + public function batchKeywordIsVideo(){ | ||
| 213 | + $this->request->validate([ | ||
| 214 | + 'title'=>['required','array', 'max:500'] | ||
| 215 | + ],[ | ||
| 216 | + 'title.required' => 'title不能为空', | ||
| 217 | + 'title.array' => 'title为数组', | ||
| 218 | + 'title.max' => '批量操作不能超过500条数据' | ||
| 219 | + ]); | ||
| 220 | + $keywordModel = new Keyword(); | ||
| 221 | + foreach ($this->param['title'] as $v){ | ||
| 222 | + $keywordModel->edit(['is_video_keyword'=>$this->param['is_video_keyword']],['title'=>$v]); | ||
| 223 | + } | ||
| 224 | + $this->response('success'); | ||
| 225 | + } | ||
| 204 | } | 226 | } |
| @@ -284,6 +284,7 @@ class UserLoginLogic | @@ -284,6 +284,7 @@ class UserLoginLogic | ||
| 284 | if($info['is_customized'] == 1){ | 284 | if($info['is_customized'] == 1){ |
| 285 | $info['is_visualization'] = json_decode($project['is_visualization']); | 285 | $info['is_visualization'] = json_decode($project['is_visualization']); |
| 286 | } | 286 | } |
| 287 | + $info['ai_video'] = $project['deploy_optimize']['ai_video']; | ||
| 287 | $info['is_visualization_authority'] = $project['deploy_build']['is_visualization_authority']; | 288 | $info['is_visualization_authority'] = $project['deploy_build']['is_visualization_authority']; |
| 288 | //是否开通AMP | 289 | //是否开通AMP |
| 289 | $is_amp = 0; | 290 | $is_amp = 0; |
| @@ -266,6 +266,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -266,6 +266,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 266 | Route::post('keyword/batchAdd', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchAdd'])->name('product_keyword_batchAdd'); | 266 | Route::post('keyword/batchAdd', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchAdd'])->name('product_keyword_batchAdd'); |
| 267 | Route::post('keyword/batchDel', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchDel'])->name('product_keyword_batchDel'); | 267 | Route::post('keyword/batchDel', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchDel'])->name('product_keyword_batchDel'); |
| 268 | Route::any('keyword/delete', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delete'])->name('product_keyword_delete'); | 268 | Route::any('keyword/delete', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delete'])->name('product_keyword_delete'); |
| 269 | + Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo'); | ||
| 269 | Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled'); | 270 | Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled'); |
| 270 | //产品参数 | 271 | //产品参数 |
| 271 | Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr'); | 272 | Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr'); |
-
请 注册 或 登录 后发表评论