|
|
|
@ -60,10 +60,14 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
$query = $model->where($map)->order("id desc");
|
|
|
|
|
$count = $query->count();
|
|
|
|
|
if($is_export){
|
|
|
|
|
$parseData = $query->field("province, city, company_name, register_capital, functionary, phone, wechat, qq, game_type, game_name, join_platform, promote_scale, turnover, address, league_info, is_potential, remark, interface_person, create_time, communication_time, create_account")->select();
|
|
|
|
|
$parseData = $query->field("province, city, company_name, register_capital, functionary, phone, wechat, qq, game_type, game_name, join_platform, promote_scale, turnover, address, league_info, is_potential, remark, interface_person, create_time, communication_time, create_account")
|
|
|
|
|
->where($map)
|
|
|
|
|
->select();
|
|
|
|
|
foreach ($parseData as &$v) {
|
|
|
|
|
if ($v['is_potential'] == 1) $v['is_potential'] = "是";
|
|
|
|
|
else $v['is_potential'] = "否";
|
|
|
|
|
$v['communication_time'] = date('Y-m-d H:i:s', $v['communication_time']);
|
|
|
|
|
$v['create_time'] = date('Y-m-d H:i:s', $v['create_time']);
|
|
|
|
|
unset($v['id']);
|
|
|
|
|
unset($v['game_id']);
|
|
|
|
|
unset($v['update_time']);
|
|
|
|
@ -78,6 +82,7 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//分页
|
|
|
|
|
$parameter = I("get.");
|
|
|
|
|
$parameter['p'] = $page;
|
|
|
|
|
$parameter['row'] = $row;
|
|
|
|
|
$page = set_pagination($count, $row, $parameter);
|
|
|
|
@ -143,6 +148,9 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
$num = $config['value'];
|
|
|
|
|
if (IS_POST) {
|
|
|
|
|
$num = I('num');
|
|
|
|
|
if ($num < 0) {
|
|
|
|
|
$this->error("时间设置不能小于0");
|
|
|
|
|
}
|
|
|
|
|
M('config', 'sys_')->where([
|
|
|
|
|
'name' => 'SOCIETY_INFO_COMMUNITION_GAP'
|
|
|
|
|
])->save([
|
|
|
|
@ -289,6 +297,11 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
foreach ($save['game_types'] as $v) {
|
|
|
|
|
$save['game_type'] .= $v . "/";
|
|
|
|
|
}
|
|
|
|
|
if ($save['province'] == '请选择省份') {
|
|
|
|
|
$save['province'] = '';
|
|
|
|
|
$save['city'] = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$save['game_type'] = trim($save['game_type'], '/');
|
|
|
|
|
$save['communication_time'] = time();
|
|
|
|
|
$save['update_time'] = time();
|
|
|
|
@ -377,38 +390,81 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
$datas = $this->parseExcelIn($filename, $exts);
|
|
|
|
|
$inserts = [];
|
|
|
|
|
foreach ($datas as $k => $v) {
|
|
|
|
|
/*foreach ($v as $p) {
|
|
|
|
|
if (!$p) {
|
|
|
|
|
$this->error("数据不能为空");
|
|
|
|
|
$flag = 0;
|
|
|
|
|
foreach ($v as $p) {
|
|
|
|
|
if (!empty($p)) {
|
|
|
|
|
$flag = 1;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
if ($flag == 0) continue;
|
|
|
|
|
if ($k == 1) continue;
|
|
|
|
|
|
|
|
|
|
$inserts[$k-2]['province'] = $v['A'] ?? '';
|
|
|
|
|
$inserts[$k-2]['city'] = $v['B'] ?? '';
|
|
|
|
|
$inserts[$k-2]['company_name'] = $v['C'] ?? '';
|
|
|
|
|
if (mb_strlen($inserts[$k-2]['company_name'], "utf-8") > 100) {
|
|
|
|
|
$this->error("公司名太长".$k);
|
|
|
|
|
}
|
|
|
|
|
if (!$inserts[$k-2]['company_name']) {
|
|
|
|
|
$this->error("公司不能为空");
|
|
|
|
|
$this->error("公司不能为空".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['register_capital'] = $v['D'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['register_capital']) > 50) {
|
|
|
|
|
$this->error("推荐人太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['functionary'] = $v['E'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['functionary']) > 50) {
|
|
|
|
|
$this->error("负责人太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['phone'] = $v['F'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['phone']) > 50) {
|
|
|
|
|
$this->error("手机号太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['wechat'] = $v['G'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['wechat']) > 50) {
|
|
|
|
|
$this->error("微信号太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['qq'] = $v['H'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['qq']) > 50) {
|
|
|
|
|
$this->error("qq号太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['game_type'] = $v['I'] ?? '';
|
|
|
|
|
$inserts[$k-2]['game_name'] = $v['J'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['game_name']) > 50) {
|
|
|
|
|
$this->error("游戏名太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['join_platform'] = $v['K'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['join_platform']) > 50) {
|
|
|
|
|
$this->error("合作平台太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['promote_scale'] = $v['L'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['promote_scale']) > 50) {
|
|
|
|
|
$this->error("推广规模太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['turnover'] = $v['M'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['turnover']) > 50) {
|
|
|
|
|
$this->error("流水太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['address'] = $v['N'] ?? '';
|
|
|
|
|
if (mb_strlen($inserts[$k-2]['address'], 'utf-8') > 100) {
|
|
|
|
|
$this->error("地址太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['league_info'] = $v['O'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['league_info']) > 100) {
|
|
|
|
|
$this->error("联盟信息太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['is_potential'] = $v['P']=="是" ? 1 : 0;
|
|
|
|
|
$inserts[$k-2]['remark'] = $v['Q'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['remark']) > 100) {
|
|
|
|
|
$this->error("备注太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['interface_person'] = $v['R'] ?? '';
|
|
|
|
|
if (strlen($inserts[$k-2]['interface_person']) > 50) {
|
|
|
|
|
$this->error("对接人太长".$k);
|
|
|
|
|
}
|
|
|
|
|
$inserts[$k-2]['create_time'] = time();
|
|
|
|
|
$inserts[$k-2]['update_time'] = time();
|
|
|
|
|
$inserts[$k-2]['communication_time'] = time();
|
|
|
|
|
$save['create_account'] = $this->admininfo['username'];
|
|
|
|
|
$inserts[$k-2]['create_account'] = $this->admininfo['username'];
|
|
|
|
|
|
|
|
|
|
$gameTypes = explode('/', $v['I']);
|
|
|
|
|
foreach ($gameTypes as $gameType) {
|
|
|
|
@ -452,6 +508,7 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
$address=$currentColumn.$currentRow;
|
|
|
|
|
//读取到的数据,保存到数组$arr中
|
|
|
|
|
$data[$currentRow][$currentColumn]=$currentSheet->getCell($address)->getValue();
|
|
|
|
|
if(is_object($data[$currentRow][$currentColumn])) $data[$currentRow][$currentColumn] = $data[$currentRow][$currentColumn]->__toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|