|
@@ -8,12 +8,13 @@ include('/share/lib/php/dever_package/excel/src/PHPExcel.php');
|
|
|
|
|
|
class Import
|
|
|
{
|
|
|
- private $name = 'qiquan_2022_05_06_01.xlsx';
|
|
|
+ private $path = '/www/churen/data/';
|
|
|
+ private $name = 'qiquan_2022_05_06_04.xlsx';
|
|
|
|
|
|
public function get_api()
|
|
|
{
|
|
|
Dever::config('base')->hook = true;
|
|
|
- $file = Dever::data() . $this->name;
|
|
|
+ $file = $this->path . $this->name;
|
|
|
|
|
|
$data = Dever::excelImport($file, 1, 5, 'excel');
|
|
|
|
|
@@ -126,7 +127,7 @@ class Import
|
|
|
public function check_api()
|
|
|
{
|
|
|
Dever::config('base')->hook = true;
|
|
|
- $file = Dever::data() . $this->name;
|
|
|
+ $file = $this->path . $this->name;
|
|
|
|
|
|
$data = Dever::excelImport($file, 1, 5, 'excel');
|
|
|
|
|
@@ -211,7 +212,7 @@ class Import
|
|
|
|
|
|
$check = Dever::input('check');
|
|
|
|
|
|
- $file = Dever::data() . $this->name;
|
|
|
+ $file = $this->path . $this->name;
|
|
|
|
|
|
$data = Dever::excelImport($file, 2, 5, 'excel');
|
|
|
|
|
@@ -240,23 +241,29 @@ class Import
|
|
|
}
|
|
|
$info = Dever::db('option/member')->find($where);
|
|
|
if ($info) {
|
|
|
- $account = Dever::db('option/account')->find(array('id' => $info['aid'], 'clear' => true));
|
|
|
- if ($account && $account['status'] < 3) {
|
|
|
- if ($check == 1) {
|
|
|
- $state = true;
|
|
|
- } else {
|
|
|
- $state = Dever::load('option/lib/cash')->up($account['id'], $info['id'], $type, $v['C'], $v['E'], false);
|
|
|
- }
|
|
|
-
|
|
|
- if ($state) {
|
|
|
- $table_status['body'][0][0] += 1;
|
|
|
- $table_status['body'][0][1] += $v['C'];
|
|
|
+ $idcard = trim($v['B']);
|
|
|
+ if ($info['idcard'] != $idcard) {
|
|
|
+ $table['body'][] = array($info['mobile'], $info['idcard'], $idcard, $type_name, '手机号和身份证不对应');
|
|
|
+ } else {
|
|
|
+ $account = Dever::db('option/account')->find(array('id' => $info['aid'], 'clear' => true));
|
|
|
+ if ($account && $account['status'] < 3) {
|
|
|
+ if ($check == 1) {
|
|
|
+ $state = true;
|
|
|
+ } else {
|
|
|
+ $state = Dever::load('option/lib/cash')->up($account['id'], $info['id'], $type, $v['C'], $v['E'], false);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($state) {
|
|
|
+ $table_status['body'][0][0] += 1;
|
|
|
+ $table_status['body'][0][1] += $v['C'];
|
|
|
+ } else {
|
|
|
+ $table['body'][] = array($info['mobile'], $info['idcard'], $v['C'], $type_name, '导入到数据表失败');
|
|
|
+ }
|
|
|
} else {
|
|
|
- $table['body'][] = array($info['mobile'], $info['idcard'], $v['C'], $type_name, '导入到数据表失败');
|
|
|
+ $table['body'][] = array($info['mobile'], $info['idcard'], $v['C'], $type_name, '未找到主账户');
|
|
|
}
|
|
|
- } else {
|
|
|
- $table['body'][] = array($info['mobile'], $info['idcard'], $v['C'], $type_name, '未找到主账户');
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
$table['body'][] = array($where['mobile'], $v['B'], $v['C'], $type_name, '未找到期权账户');
|
|
|
}
|
|
@@ -287,7 +294,7 @@ class Import
|
|
|
{
|
|
|
Dever::config('base')->hook = true;
|
|
|
$check = Dever::input('check');
|
|
|
- $file = Dever::data() . $this->name;
|
|
|
+ $file = $this->path . $this->name;
|
|
|
|
|
|
$data = Dever::excelImport($file, 3, 5, 'excel');
|
|
|
|
|
@@ -315,21 +322,26 @@ class Import
|
|
|
}
|
|
|
$info = Dever::db('option/member')->find($where);
|
|
|
if ($info) {
|
|
|
- $account = Dever::db('option/account')->find($info['aid']);
|
|
|
- if ($account && $account['status'] < 3) {
|
|
|
- if ($check == 1) {
|
|
|
- $state = true;
|
|
|
- } else {
|
|
|
- $state = Dever::load('option/lib/cash')->up($account['id'], $info['id'], $type, $v['C'], $v['E'], false);
|
|
|
- }
|
|
|
- if ($state) {
|
|
|
- $table_status['body'][0][0] += 1;
|
|
|
- $table_status['body'][0][1] += $v['C'];
|
|
|
+ $idcard = trim($v['B']);
|
|
|
+ if ($info['idcard'] != $idcard) {
|
|
|
+ $table['body'][] = array($info['mobile'], $info['idcard'], $idcard, $type_name, '手机号和身份证不对应');
|
|
|
+ } else {
|
|
|
+ $account = Dever::db('option/account')->find($info['aid']);
|
|
|
+ if ($account && $account['status'] < 3) {
|
|
|
+ if ($check == 1) {
|
|
|
+ $state = true;
|
|
|
+ } else {
|
|
|
+ $state = Dever::load('option/lib/cash')->up($account['id'], $info['id'], $type, $v['C'], $v['E'], false);
|
|
|
+ }
|
|
|
+ if ($state) {
|
|
|
+ $table_status['body'][0][0] += 1;
|
|
|
+ $table_status['body'][0][1] += $v['C'];
|
|
|
+ } else {
|
|
|
+ $table['body'][] = array($info['mobile'], $info['idcard'], $v['C'], $type_name, '交付价值不足');
|
|
|
+ }
|
|
|
} else {
|
|
|
- $table['body'][] = array($info['mobile'], $info['idcard'], $v['C'], $type_name, '交付价值不足');
|
|
|
+ $table['body'][] = array($info['mobile'], $info['idcard'], $v['C'], $type_name, '未找到主账户');
|
|
|
}
|
|
|
- } else {
|
|
|
- $table['body'][] = array($info['mobile'], $info['idcard'], $v['C'], $type_name, '未找到主账户');
|
|
|
}
|
|
|
} else {
|
|
|
$table['body'][] = array($where['mobile'], $v['B'], $v['C'], $type_name, '未找到期权账户');
|