|
@@ -41,23 +41,27 @@ class lyhDemo extends Command |
|
@@ -41,23 +41,27 @@ class lyhDemo extends Command |
|
41
|
protected $description = '更新路由';
|
41
|
protected $description = '更新路由';
|
|
42
|
|
42
|
|
|
43
|
public function handle(){
|
43
|
public function handle(){
|
|
44
|
- return $this->aggregate_keyword_affix();
|
|
|
|
45
|
- //获取
|
|
|
|
46
|
-// $keywordPrefixModel = new KeywordPrefix();
|
|
|
|
47
|
-// $lists = $keywordPrefixModel->list(['project_id'=>0,'id'=>['<',29]]);
|
|
|
|
48
|
-// $whiteModel = new ProjectWhiteHatAffix();
|
|
|
|
49
|
-// foreach ($lists as $val) {
|
|
|
|
50
|
-// echo date('Y-m-d H:i:s') . '开始--项目的id:' . $val['id'] . PHP_EOL;
|
|
|
|
51
|
-// $data = [
|
|
|
|
52
|
-// 'project_id'=>0,
|
|
|
|
53
|
-// 'name'=>$val['keyword'],
|
|
|
|
54
|
-// 'type'=>$val['type'],
|
|
|
|
55
|
-// ];
|
|
|
|
56
|
-// $whiteModel->add($data);
|
|
|
|
57
|
-// }
|
44
|
+ self::initAggregateKeywordAffix();
|
|
58
|
return true;
|
45
|
return true;
|
|
59
|
}
|
46
|
}
|
|
60
|
|
47
|
|
|
|
|
48
|
+ public static function initAggregateKeywordAffix($project_id = 4298){
|
|
|
|
49
|
+ $time = date('Y-m-d H:i:s');
|
|
|
|
50
|
+ $prefix = "How To find"."\n"."Why Choose"."\n"."China Top"."\n"."Best Way To Choose"."\n"."Methods To Choose";
|
|
|
|
51
|
+ $suffix = "Manufacturer"."\n"."Supplier"."\n"."Products"."\n"."Factory";
|
|
|
|
52
|
+ $info = DB::table('gl_aggregate_keyword_affix')->where('project_id',$project_id)->first();
|
|
|
|
53
|
+ if(empty($info)){
|
|
|
|
54
|
+ $data = [
|
|
|
|
55
|
+ 'project_id'=>$project_id,
|
|
|
|
56
|
+ 'prefix'=>$prefix,
|
|
|
|
57
|
+ 'suffix'=>$suffix,
|
|
|
|
58
|
+ 'created_at' => $time,
|
|
|
|
59
|
+ 'updated_at' => $time
|
|
|
|
60
|
+ ];
|
|
|
|
61
|
+ DB::table('gl_aggregate_keyword_affix')->insert($data);
|
|
|
|
62
|
+ }
|
|
|
|
63
|
+ return true;
|
|
|
|
64
|
+ }
|
|
61
|
/**
|
65
|
/**
|
|
62
|
* @remark :获取数据
|
66
|
* @remark :获取数据
|
|
63
|
* @name :aggregate_keyword_affix
|
67
|
* @name :aggregate_keyword_affix
|