合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !1881
正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
| @@ -190,7 +190,7 @@ class RecommendedSuppliers extends Command | @@ -190,7 +190,7 @@ class RecommendedSuppliers extends Command | ||
| 190 | public function getKeywords($project_id){ | 190 | public function getKeywords($project_id){ |
| 191 | $keywordModel = new Keyword(); | 191 | $keywordModel = new Keyword(); |
| 192 | $keyword_array = $this->getPurchaserList($project_id); | 192 | $keyword_array = $this->getPurchaserList($project_id); |
| 193 | - $title = $keywordModel->where('title', 'not in', $keyword_array)->orderRaw('RAND()')->limit(1)->value('title'); // 只返回 title 字段 | 193 | + $title = $keywordModel->whereNotIn('title', $keyword_array)->inRandomOrder()->limit(1)->value('title'); |
| 194 | if(empty($title)){ | 194 | if(empty($title)){ |
| 195 | return ''; | 195 | return ''; |
| 196 | } | 196 | } |
| @@ -207,6 +207,9 @@ class RecommendedSuppliers extends Command | @@ -207,6 +207,9 @@ class RecommendedSuppliers extends Command | ||
| 207 | public function savePurchaserInfo($project_id,$keyword,$data){ | 207 | public function savePurchaserInfo($project_id,$keyword,$data){ |
| 208 | $purchaserInfoModel = new PurchaserInfo(); | 208 | $purchaserInfoModel = new PurchaserInfo(); |
| 209 | foreach ($data as $k =>$v){ | 209 | foreach ($data as $k =>$v){ |
| 210 | + if(empty($v['buyer_id'])){ | ||
| 211 | + continue; | ||
| 212 | + } | ||
| 210 | $v['project_id'] = $project_id; | 213 | $v['project_id'] = $project_id; |
| 211 | $v['keyword'] = $keyword; | 214 | $v['keyword'] = $keyword; |
| 212 | $v['email'] = json_encode($v['email']??[],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | 215 | $v['email'] = json_encode($v['email']??[],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
-
请 注册 或 登录 后发表评论