作者 lyh

gx

... ... @@ -107,11 +107,30 @@ class RecommendedSuppliers extends Command
$purchaserModel = new Purchaser();
$purchaserModel->add($saveData);
$this->savePurchaserInfo($project_id,$keyword,$res['data']);
}else{
$title = $this->getKeywords($project_id);
$this->savePurchaser($project_id,$title);
}
return true;
}
/**
* @remark :取关键词
* @name :getKeywords
* @author :lyh
* @method :post
* @time :2024/7/1 18:07
*/
public function getKeywords($project_id){
$info = Keyword::inRandomOrder()->first();
$keywordInfo = $this->getPurchaser($info->title,$project_id);
if($keywordInfo !== false){
$this->getKeywords($project_id);
}
return $info->title;
}
/**
* @remark :保存供应商详情
* @name :savePurchaserInfo
* @author :lyh
... ...
... ... @@ -50,7 +50,7 @@ class UpdateProductCategory extends Command
public function handle(){
//获取所有项目
$projectModel = new Project();
$list = $projectModel->list(['id'=>['!=',[1515]],'type'=>['!=',0]],'id',['id']);
$list = $projectModel->list(['id'=>978],'id',['id']);
echo date('Y-m-d H:i:s') . ' start: ' . json_encode($list) . PHP_EOL;
try {
foreach ($list as $v) {
... ...