作者 zhl

u num

@@ -90,7 +90,7 @@ class VideoTask extends Command @@ -90,7 +90,7 @@ class VideoTask extends Command
90 continue; 90 continue;
91 } 91 }
92 ProjectServer::useProject($task_project->project_id); 92 ProjectServer::useProject($task_project->project_id);
93 - $keyword = $this->getProjectKeyword(); 93 + $keyword = $this->getProjectKeyword($task_project->number);
94 // 已经没有需要生成视频的关键词 94 // 已经没有需要生成视频的关键词
95 if (!$keyword) { 95 if (!$keyword) {
96 $task_project->status = KeywordVideoTask::STATUS_CLOSE; 96 $task_project->status = KeywordVideoTask::STATUS_CLOSE;
@@ -155,12 +155,13 @@ class VideoTask extends Command @@ -155,12 +155,13 @@ class VideoTask extends Command
155 155
156 /** 156 /**
157 * 获取未生成页面的关键词 157 * 获取未生成页面的关键词
  158 + * @param $number
158 * @return mixed 159 * @return mixed
159 */ 160 */
160 - public function getProjectKeyword() 161 + public function getProjectKeyword($number)
161 { 162 {
162 $keyword_arr_id = Keyword::where('video', null)->whereNotNull('keyword_content')->pluck('id')->toArray(); 163 $keyword_arr_id = Keyword::where('video', null)->whereNotNull('keyword_content')->pluck('id')->toArray();
163 - $keyword_id = array_rand($keyword_arr_id, 500); 164 + $keyword_id = array_rand($keyword_arr_id, $number);
164 $keyword = Keyword::whereIn("id", $keyword_id)->get(); 165 $keyword = Keyword::whereIn("id", $keyword_id)->get();
165 return $keyword; 166 return $keyword;
166 } 167 }