Commit 42562ff9 authored by 王源's avatar 王源 🎧

编写excel导入公共文件方法

parent 79fdedbe
...@@ -228,4 +228,28 @@ class ExcelImporter ...@@ -228,4 +228,28 @@ class ExcelImporter
return $this->errorColumn; return $this->errorColumn;
} }
/**
* 对比不同的数据,返回是否有不同
* @param array $list
* @param array $data
* @return bool
*/
public static function checkDiffVal(array $list, array $data)
{
foreach ($list as $key => $val) {
if (isset($data[$key]) && $data[$key]) {
if (is_array($val)) {
if (self::checkDiffVal($val, $data[$key])) {
return true;
}
} else {
if ($list[$key] !== $data[$key]) {
return true;
}
}
}
}
return false;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment