正在显示
1 个修改的文件
包含
16 行增加
和
2 行删除
| @@ -12,6 +12,7 @@ namespace App\Console\Commands\Suppliers; | @@ -12,6 +12,7 @@ namespace App\Console\Commands\Suppliers; | ||
| 12 | use App\Models\Product\Keyword; | 12 | use App\Models\Product\Keyword; |
| 13 | use App\Models\Project\DeployBuild; | 13 | use App\Models\Project\DeployBuild; |
| 14 | use App\Models\Purchaser\Purchaser; | 14 | use App\Models\Purchaser\Purchaser; |
| 15 | +use App\Models\Purchaser\PurchaserInfo; | ||
| 15 | use App\Services\ProjectServer; | 16 | use App\Services\ProjectServer; |
| 16 | use Illuminate\Console\Command; | 17 | use Illuminate\Console\Command; |
| 17 | use Illuminate\Support\Facades\DB; | 18 | use Illuminate\Support\Facades\DB; |
| @@ -105,6 +106,7 @@ class RecommendedSuppliers extends Command | @@ -105,6 +106,7 @@ class RecommendedSuppliers extends Command | ||
| 105 | ]; | 106 | ]; |
| 106 | $purchaserModel = new Purchaser(); | 107 | $purchaserModel = new Purchaser(); |
| 107 | $purchaserModel->add($saveData); | 108 | $purchaserModel->add($saveData); |
| 109 | + $this->savePurchaserInfo($project_id,$keyword,$res['data']); | ||
| 108 | } | 110 | } |
| 109 | return true; | 111 | return true; |
| 110 | } | 112 | } |
| @@ -116,7 +118,19 @@ class RecommendedSuppliers extends Command | @@ -116,7 +118,19 @@ class RecommendedSuppliers extends Command | ||
| 116 | * @method :post | 118 | * @method :post |
| 117 | * @time :2024/5/29 16:38 | 119 | * @time :2024/5/29 16:38 |
| 118 | */ | 120 | */ |
| 119 | - public function savePurchaserInfo(){ | ||
| 120 | - | 121 | + public function savePurchaserInfo($project_id,$keyword,$data){ |
| 122 | + $param = []; | ||
| 123 | + foreach ($data as $k =>$v){ | ||
| 124 | + $v['project_id'] = $project_id; | ||
| 125 | + $v['keyword'] = $keyword; | ||
| 126 | + $v['email'] = json_encode($v['email'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||
| 127 | + $v['mobile'] = json_encode($v['mobile'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||
| 128 | + $v['social_media'] = json_encode($v['social_media'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | ||
| 129 | + $v['created_at'] = date('Y-m-d H:i:s'); | ||
| 130 | + $v['updated_at'] = $v['created_at']; | ||
| 131 | + $param[] = $v; | ||
| 132 | + } | ||
| 133 | + $purchaserInfoModel = new PurchaserInfo(); | ||
| 134 | + return $purchaserInfoModel->insert($param); | ||
| 121 | } | 135 | } |
| 122 | } | 136 | } |
-
请 注册 或 登录 后发表评论