$v) { $state = preg_match(Dever::rule('mobile'), $v['C']); if ($state) { $where['key'] = $v['A']; $where['mobile'] = $v['C']; $info = Dever::db('option/account')->find($where); $update = $where; $update['idcard'] = $v['D']; $update['name'] = $v['B']; $update['type'] = $v['E'] ? 2 : 1; if (!$info) { $update['audit'] = 1; Dever::db('option/account')->insert($update); } else { $update['where_id'] = $info['id']; Dever::db('option/account')->update($update); } } } } return 'ok'; } # 导入交付记录 public function get_jiaofu_api() { $file = Dever::data() . 'qiquan.xlsx'; $data = Dever::excelImport($file, 2, 5, 'excel'); if ($data) { foreach ($data as $k => $v) { $state = preg_match(Dever::rule('mobile'), $v['A']); if ($state && $v['C'] > 0) { $where['mobile'] = $v['A']; $type_name = $v['D']; if ($type_name == '期权') { $type = 1; } else { $type = 4; } $info = Dever::db('option/account')->find($where); if ($info && $info['status'] < 3) { $info = Dever::db('option/account')->find(array('key' => $info['key'], 'type' => 2)); if ($info && $info['status'] < 3) { Dever::load('option/lib/cash')->up($info['id'], $type, $v['C'], $v['E'], false); } } } } } return 'ok'; } # 导入发放记录 public function get_fafang_api() { $file = Dever::data() . 'qiquan.xlsx'; $data = Dever::excelImport($file, 3, 5, 'excel'); if ($data) { foreach ($data as $k => $v) { $state = preg_match(Dever::rule('mobile'), $v['A']); if ($state && $v['C'] > 0) { $where['mobile'] = $v['A']; $type_name = $v['D']; if ($type_name == '期权') { $type = 2; } else { $type = 5; } $info = Dever::db('option/account')->find($where); if ($info && $info['status'] < 3) { $info = Dever::db('option/account')->find(array('key' => $info['key'], 'type' => 2)); if ($info && $info['status'] < 3) { Dever::load('option/lib/cash')->up($info['id'], $type, $v['C'], $v['E'], false); } } } } } return 'ok'; } }