作者 lyh

gx

... ... @@ -12,6 +12,7 @@ namespace App\Console\Commands\Suppliers;
use App\Models\Product\Keyword;
use App\Models\Project\DeployBuild;
use App\Models\Purchaser\Purchaser;
use App\Models\Purchaser\PurchaserInfo;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -105,6 +106,7 @@ class RecommendedSuppliers extends Command
];
$purchaserModel = new Purchaser();
$purchaserModel->add($saveData);
$this->savePurchaserInfo($project_id,$keyword,$res['data']);
}
return true;
}
... ... @@ -116,7 +118,19 @@ class RecommendedSuppliers extends Command
* @method :post
* @time :2024/5/29 16:38
*/
public function savePurchaserInfo(){
public function savePurchaserInfo($project_id,$keyword,$data){
$param = [];
foreach ($data as $k =>$v){
$v['project_id'] = $project_id;
$v['keyword'] = $keyword;
$v['email'] = json_encode($v['email'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
$v['mobile'] = json_encode($v['mobile'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
$v['social_media'] = json_encode($v['social_media'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = $v['created_at'];
$param[] = $v;
}
$purchaserInfoModel = new PurchaserInfo();
return $purchaserInfoModel->insert($param);
}
}
... ...