合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !1844
正在显示
1 个修改的文件
包含
9 行增加
和
2 行删除
| @@ -55,8 +55,11 @@ class RecommendedSuppliers extends Command | @@ -55,8 +55,11 @@ class RecommendedSuppliers extends Command | ||
| 55 | */ | 55 | */ |
| 56 | public function handle() | 56 | public function handle() |
| 57 | { | 57 | { |
| 58 | - $project_list = $this->deployBuildModel->list(['is_supplier'=>1]);//TODO::已开启推荐供应商 | 58 | + $projectModel = new Project(); |
| 59 | + $projectArr = $projectModel->selectField(['delete_status'=>0,'type'=>['in',[2,3,4]]],'id'); | ||
| 60 | + $project_list = $this->deployBuildModel->list(['is_supplier'=>1,'project_id'=>['in',$projectArr]]);//TODO::已开启推荐供应商 | ||
| 59 | foreach ($project_list as $v){ | 61 | foreach ($project_list as $v){ |
| 62 | + try { | ||
| 60 | echo date('Y-m-d H:i:s') . '推荐供应商执行的project_id:'.$v['project_id'] . PHP_EOL; | 63 | echo date('Y-m-d H:i:s') . '推荐供应商执行的project_id:'.$v['project_id'] . PHP_EOL; |
| 61 | $result = $this->countPurchaser($v); | 64 | $result = $this->countPurchaser($v); |
| 62 | if($result !== false){ | 65 | if($result !== false){ |
| @@ -69,6 +72,10 @@ class RecommendedSuppliers extends Command | @@ -69,6 +72,10 @@ class RecommendedSuppliers extends Command | ||
| 69 | } | 72 | } |
| 70 | DB::disconnect('custom_mysql'); | 73 | DB::disconnect('custom_mysql'); |
| 71 | } | 74 | } |
| 75 | + }catch (\Exception $e){ | ||
| 76 | + echo date('Y-m-d hH:i:s').'当前项目执行错误:'.$e->getMessage().PHP_EOL; | ||
| 77 | + continue; | ||
| 78 | + } | ||
| 72 | } | 79 | } |
| 73 | return true; | 80 | return true; |
| 74 | } | 81 | } |
| @@ -152,7 +159,7 @@ class RecommendedSuppliers extends Command | @@ -152,7 +159,7 @@ class RecommendedSuppliers extends Command | ||
| 152 | 'total'=>$this->param['row'] ?? 10, | 159 | 'total'=>$this->param['row'] ?? 10, |
| 153 | ]; | 160 | ]; |
| 154 | $res = http_post($url,json_encode($param)); | 161 | $res = http_post($url,json_encode($param)); |
| 155 | - echo '请求返回状态'. $res['code']?? ''.PHP_EOL; | 162 | + echo '请求返回状态'. ($res['code']?? '').PHP_EOL; |
| 156 | // echo date('Y-m-d H:i:s') . json_encode($res) . PHP_EOL; | 163 | // echo date('Y-m-d H:i:s') . json_encode($res) . PHP_EOL; |
| 157 | if(!empty($res) && isset($res['code']) && $res['code'] == 200 && !empty($res['data'])){ | 164 | if(!empty($res) && isset($res['code']) && $res['code'] == 200 && !empty($res['data'])){ |
| 158 | //保存多条数据 | 165 | //保存多条数据 |
-
请 注册 或 登录 后发表评论