作者 Your Name
... ... @@ -189,11 +189,11 @@ class VideoTask extends Command
public function getProjectKeyword($number,$keywords = [])
{
$keyword_id = Keyword::where('video', null)->whereIn("title", $keywords)
$keyword_id = Keyword::where('video', null)->whereIn("title", $keywords)->whereNull('deleted_at')
->where('route', 'not like', '%-tag')->whereNotNull('keyword_content')->limit($number)->pluck('id')->toArray();
$need = $number - count($keyword_id);
if ($need > 0) {
$keyword_arr_id = Keyword::where('video', null)->where('route', 'not like', '%-tag')
$keyword_arr_id = Keyword::where('video', null)->where('route', 'not like', '%-tag')->whereNull('deleted_at')
->whereNotNull('keyword_content')->whereNotIn('id', $keyword_id)->orderBy('id','asc')->limit($need)->pluck('id')->toArray();
}
$keyword_arr_id = array_merge($keyword_id, $keyword_arr_id);
... ...
... ... @@ -55,13 +55,13 @@ class UpdateRoute extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['id'=>['in',[147]]]);
$list = $projectModel->list(['id'=>['in',[1891]]]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->getProduct();
// $this->setProductKeyword();
$this->setProductKeyword();
// $this->getBlog();
DB::disconnect('custom_mysql');
}
... ... @@ -215,7 +215,7 @@ class UpdateRoute extends Command
public function getProduct(){
$productModel = new Product();
$lists = $productModel->list(['status'=>2]);
$lists = $productModel->list(['status'=>['!=',2]]);
if(!empty($lists)){
foreach ($lists as $v){
if(!empty($v['route'])){
... ...