clues update for import not filter repeat

This commit is contained in:
xxb
2021-07-21 10:57:16 +08:00
committed by lccsw
parent fc7e2109df
commit 0abe72482c
+6 -2
View File
@@ -163,7 +163,6 @@ class Clues extends HD_Controller{
);
}
}
$data && $data = array_unique($data); //去除重复数据
$done = $this->add_batch($data);
@unlink($file);
$this->data['load_num'] = count($data);
@@ -293,11 +292,14 @@ class Clues extends HD_Controller{
$where = array('status' => 1);
$select = 'id, title';
$map_cfrom = $this->clues_cfrom_model->map('title', 'id', $where, '', 0, 0, $select);
foreach($lists as $v){
$fails= array();
foreach($lists as $k => $v){
if(!$v['name']){
$fails[] = array('data' => $v, 'msg' => 'name is null');
continue;
}
if(!mobile_valid($v['mobile'])){
$fails[] = array('data' => $v, 'msg' => 'mobile valid fail');
continue;
}
$cf_id = $map_cfrom[$v['cfrom']];
@@ -310,6 +312,8 @@ class Clues extends HD_Controller{
$done++;
}
$fails && debug_log('[warning]# fails=' . json_encode($fails), __FUNCTION__, $this->log_dir);
if($adds){
$ret = $this->clues_model->add_batch($adds);
if(!$ret){