作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !3300
@@ -232,21 +232,19 @@ class IndexController extends BaseController @@ -232,21 +232,19 @@ class IndexController extends BaseController
232 public function prInfoDownload() 232 public function prInfoDownload()
233 { 233 {
234 $url = 'http://crawl.scraper.waimaoq.com/export/issuewire'; 234 $url = 'http://crawl.scraper.waimaoq.com/export/issuewire';
235 - $response = Http::withHeaders([  
236 - 'Accept' => 'application/json',  
237 - ])->get($url, [ 235 + $param = [
238 'page' => $this->page, 236 'page' => $this->page,
239 'pagesize' => $this->row, 237 'pagesize' => $this->row,
240 - 'token' => 'MT0CM7y4tdFTFTm'  
241 - ]); 238 + 'token' => 'MT0CM7y4tdFTFTm',
  239 + 'pr_id' => $this->param['pr_id'],
  240 + 'release_time_start'=>$this->param['release_time_start'],
  241 + 'release_time_end'=>$this->param['release_time_end'],
  242 + ];
  243 + $param = array_filter($param);
  244 + $response = Http::withHeaders(['Accept' => 'application/json',])->get($url, $param);
242 if ($response->successful()) { 245 if ($response->successful()) {
243 $result = $response->json(); 246 $result = $response->json();
244 - $this->response('success', Code::SUCCESS, [  
245 - 'url' => $url,  
246 - 'list' => $result,  
247 - 'page' => $this->page,  
248 - 'pagesize' => $this->row  
249 - ]); 247 + $this->response('success', Code::SUCCESS, ['url' => $url, 'list' => $result, 'page' => $this->page, 'pagesize' => $this->row]);
250 } else { 248 } else {
251 $this->response('请求失败', Code::SYSTEM_ERROR, ['status_code' => $response->status(), 'error' => $response->body()]); 249 $this->response('请求失败', Code::SYSTEM_ERROR, ['status_code' => $response->status(), 'error' => $response->body()]);
252 } 250 }
@@ -92,12 +92,15 @@ class GeoArticleLogic extends BaseLogic @@ -92,12 +92,15 @@ class GeoArticleLogic extends BaseLogic
92 if(!empty($this->param['data'])){ 92 if(!empty($this->param['data'])){
93 $data = []; 93 $data = [];
94 foreach ($this->param['data'] as $item){ 94 foreach ($this->param['data'] as $item){
  95 + $info = $this->model->read(['url'=>$item['url'],'filename'=>$item['filename']]);
  96 + if($info === false){
95 $data[] = [ 97 $data[] = [
96 'filename' => $item['filename'], 98 'filename' => $item['filename'],
97 'url'=> $item['url'], 99 'url'=> $item['url'],
98 'project_id'=>$this->param['project_id'] 100 'project_id'=>$this->param['project_id']
99 ]; 101 ];
100 } 102 }
  103 + }
101 $this->model->insertAll($data); 104 $this->model->insertAll($data);
102 } 105 }
103 }catch (\Exception $e){ 106 }catch (\Exception $e){