作者 lyh

变更数据

@@ -232,11 +232,16 @@ class IndexController extends BaseController @@ -232,11 +232,16 @@ 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(['Accept' => 'application/json',])->get($url, [ 235 + $param = [
236 'page' => $this->page, 236 'page' => $this->page,
237 'pagesize' => $this->row, 237 'pagesize' => $this->row,
238 - 'token' => 'MT0CM7y4tdFTFTm'  
239 - ]); 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);
240 if ($response->successful()) { 245 if ($response->successful()) {
241 $result = $response->json(); 246 $result = $response->json();
242 $this->response('success', Code::SUCCESS, ['url' => $url, 'list' => $result, 'page' => $this->page, 'pagesize' => $this->row]); 247 $this->response('success', Code::SUCCESS, ['url' => $url, 'list' => $result, 'page' => $this->page, 'pagesize' => $this->row]);
@@ -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){