作者 lyh

变更数据

... ... @@ -76,6 +76,9 @@ class GeoLinkLogic extends BaseLogic
if(!empty($this->param['data'])){
$data = [];
foreach ($this->param['data'] as $item){
//查看当前Url是否存在
$info = $this->model->read(['url'=>$item['url'],'type'=>$this->model::TYPE_NEWS,'project_id'=>$this->param['project_id']]);
if($info === false){
$data[] = [
'project_id'=>$this->param['project_id'],
'da'=>$item['da'] ?? 0,
... ... @@ -83,6 +86,7 @@ class GeoLinkLogic extends BaseLogic
'send_time'=>$item['send_time']
];
}
}
$this->model->insertAll($data);
}
}catch (\Exception $e){
... ...
... ... @@ -44,6 +44,7 @@ class LinkDataLogic extends BaseLogic
public function batchSave(){
$data = [];
foreach ($this->param['data'] as $v){
//todo::数据去重
$data[] = [
'url'=>$v['url'],
'da'=>$v['da_values'],
... ...