作者 lyh

gx

... ... @@ -58,12 +58,20 @@ class RecommendedSuppliers extends Command
if(empty($keywordInfo)){
continue;
}
$this->getPurchaser($v['id'],$keywordInfo['title']);
$keywordInfo = $this->getPurchaser($keywordInfo['title']);
if($keywordInfo !== false){
continue;
}
$this->savePurchaser($v['id'],$keywordInfo['title']);
DB::disconnect('custom_mysql');
}
return true;
}
public function getPurchaser($keyword){
$purchaserModel = new Purchaser();
return $purchaserModel->read(['keyword'=>$keyword]);
}
/**
* @remark :保存供应商
... ... @@ -72,7 +80,7 @@ class RecommendedSuppliers extends Command
* @method :post
* @time :2024/3/5 11:38
*/
public function getPurchaser($project_id,$keyword,$row = 10){
public function savePurchaser($project_id,$keyword,$row = 10){
$url = 'https://admin.hagro.cn/api/company_list';
$data = [
'prod_desc'=>$keyword,
... ...