|
@@ -107,11 +107,30 @@ class RecommendedSuppliers extends Command |
|
@@ -107,11 +107,30 @@ class RecommendedSuppliers extends Command |
|
107
|
$purchaserModel = new Purchaser();
|
107
|
$purchaserModel = new Purchaser();
|
|
108
|
$purchaserModel->add($saveData);
|
108
|
$purchaserModel->add($saveData);
|
|
109
|
$this->savePurchaserInfo($project_id,$keyword,$res['data']);
|
109
|
$this->savePurchaserInfo($project_id,$keyword,$res['data']);
|
|
|
|
110
|
+ }else{
|
|
|
|
111
|
+ $title = $this->getKeywords($project_id);
|
|
|
|
112
|
+ $this->savePurchaser($project_id,$title);
|
|
110
|
}
|
113
|
}
|
|
111
|
return true;
|
114
|
return true;
|
|
112
|
}
|
115
|
}
|
|
113
|
|
116
|
|
|
114
|
/**
|
117
|
/**
|
|
|
|
118
|
+ * @remark :取关键词
|
|
|
|
119
|
+ * @name :getKeywords
|
|
|
|
120
|
+ * @author :lyh
|
|
|
|
121
|
+ * @method :post
|
|
|
|
122
|
+ * @time :2024/7/1 18:07
|
|
|
|
123
|
+ */
|
|
|
|
124
|
+ public function getKeywords($project_id){
|
|
|
|
125
|
+ $info = Keyword::inRandomOrder()->first();
|
|
|
|
126
|
+ $keywordInfo = $this->getPurchaser($info->title,$project_id);
|
|
|
|
127
|
+ if($keywordInfo !== false){
|
|
|
|
128
|
+ $this->getKeywords($project_id);
|
|
|
|
129
|
+ }
|
|
|
|
130
|
+ return $info->title;
|
|
|
|
131
|
+ }
|
|
|
|
132
|
+
|
|
|
|
133
|
+ /**
|
|
115
|
* @remark :保存供应商详情
|
134
|
* @remark :保存供应商详情
|
|
116
|
* @name :savePurchaserInfo
|
135
|
* @name :savePurchaserInfo
|
|
117
|
* @author :lyh
|
136
|
* @author :lyh
|