作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !2224
... ... @@ -41,27 +41,9 @@ class lyhDemo extends Command
protected $description = '更新路由';
public function handle(){
self::initAggregateKeywordAffix();
return true;
return $this->aggregate_keyword_affix();
}
public static function initAggregateKeywordAffix($project_id = 4298){
$time = date('Y-m-d H:i:s');
$prefix = "How To find"."\n"."Why Choose"."\n"."China Top"."\n"."Best Way To Choose"."\n"."Methods To Choose";
$suffix = "Manufacturer"."\n"."Supplier"."\n"."Products"."\n"."Factory";
$info = DB::table('gl_aggregate_keyword_affix')->where('project_id',$project_id)->first();
if(empty($info)){
$data = [
'project_id'=>$project_id,
'prefix'=>$prefix,
'suffix'=>$suffix,
'created_at' => $time,
'updated_at' => $time
];
DB::table('gl_aggregate_keyword_affix')->insert($data);
}
return true;
}
/**
* @remark :获取数据
* @name :aggregate_keyword_affix
... ... @@ -71,7 +53,7 @@ class lyhDemo extends Command
*/
public function aggregate_keyword_affix(){
$projectModel = new Project();
$lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,4]]], 'id', ['id']);
$lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,4]]], 'id', ['id']);
$keywordAffixModel = new AggregateKeywordAffix();
foreach ($lists as $val){
$info = $keywordAffixModel->read(['project_id'=>$val['id']]);
... ...