Merge pull request '优化' (#63) from feature/1228zgc into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/63
master
张谷成 4 years ago
commit 83148cd777

@ -60,7 +60,9 @@ class SocietyInfoController extends ThinkController
$query = $model->where($map)->order("id desc"); $query = $model->where($map)->order("id desc");
$count = $query->count(); $count = $query->count();
if($is_export){ 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) { foreach ($parseData as &$v) {
if ($v['is_potential'] == 1) $v['is_potential'] = "是"; if ($v['is_potential'] == 1) $v['is_potential'] = "是";
else $v['is_potential'] = "否"; else $v['is_potential'] = "否";
@ -80,6 +82,7 @@ class SocietyInfoController extends ThinkController
} }
//分页 //分页
$parameter = I("get.");
$parameter['p'] = $page; $parameter['p'] = $page;
$parameter['row'] = $row; $parameter['row'] = $row;
$page = set_pagination($count, $row, $parameter); $page = set_pagination($count, $row, $parameter);
@ -387,34 +390,77 @@ class SocietyInfoController extends ThinkController
$datas = $this->parseExcelIn($filename, $exts); $datas = $this->parseExcelIn($filename, $exts);
$inserts = []; $inserts = [];
foreach ($datas as $k => $v) { foreach ($datas as $k => $v) {
/*foreach ($v as $p) { $flag = 0;
if (!$p) { foreach ($v as $p) {
$this->error("数据不能为空"); if (!empty($p)) {
$flag = 1;
} }
}*/ }
if ($flag == 0) continue;
if ($k == 1) continue; if ($k == 1) continue;
$inserts[$k-2]['province'] = $v['A'] ?? ''; $inserts[$k-2]['province'] = $v['A'] ?? '';
$inserts[$k-2]['city'] = $v['B'] ?? ''; $inserts[$k-2]['city'] = $v['B'] ?? '';
$inserts[$k-2]['company_name'] = $v['C'] ?? ''; $inserts[$k-2]['company_name'] = $v['C'] ?? '';
if (strlen($inserts[$k-2]['company_name']) > 100) {
$this->error("公司名太长".$k);
}
if (!$inserts[$k-2]['company_name']) { if (!$inserts[$k-2]['company_name']) {
$this->error("公司不能为空"); $this->error("公司不能为空".$k);
} }
$inserts[$k-2]['register_capital'] = $v['D'] ?? ''; $inserts[$k-2]['register_capital'] = $v['D'] ?? '';
if (strlen($inserts[$k-2]['register_capital']) > 50) {
$this->error("推荐人太长".$k);
}
$inserts[$k-2]['functionary'] = $v['E'] ?? ''; $inserts[$k-2]['functionary'] = $v['E'] ?? '';
if (strlen($inserts[$k-2]['functionary']) > 50) {
$this->error("负责人太长".$k);
}
$inserts[$k-2]['phone'] = $v['F'] ?? ''; $inserts[$k-2]['phone'] = $v['F'] ?? '';
if (strlen($inserts[$k-2]['phone']) > 50) {
$this->error("手机号太长".$k);
}
$inserts[$k-2]['wechat'] = $v['G'] ?? ''; $inserts[$k-2]['wechat'] = $v['G'] ?? '';
if (strlen($inserts[$k-2]['wechat']) > 50) {
$this->error("微信号太长".$k);
}
$inserts[$k-2]['qq'] = $v['H'] ?? ''; $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_type'] = $v['I'] ?? '';
$inserts[$k-2]['game_name'] = $v['J'] ?? ''; $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'] ?? ''; $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'] ?? ''; $inserts[$k-2]['promote_scale'] = $v['L'] ?? '';
if (strlen($inserts[$k-2]['promote_scale']) > 50) {
$this->error("推广规模太长".$k);
}
$inserts[$k-2]['turnover'] = $v['M'] ?? ''; $inserts[$k-2]['turnover'] = $v['M'] ?? '';
if (strlen($inserts[$k-2]['turnover']) > 50) {
$this->error("流水太长".$k);
}
$inserts[$k-2]['address'] = $v['N'] ?? ''; $inserts[$k-2]['address'] = $v['N'] ?? '';
if (strlen($inserts[$k-2]['address']) > 100) {
$this->error("地址太长".$k);
}
$inserts[$k-2]['league_info'] = $v['O'] ?? ''; $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]['is_potential'] = $v['P']=="是" ? 1 : 0;
$inserts[$k-2]['remark'] = $v['Q'] ?? ''; $inserts[$k-2]['remark'] = $v['Q'] ?? '';
if (strlen($inserts[$k-2]['remark']) > 100) {
$this->error("备注太长".$k);
}
$inserts[$k-2]['interface_person'] = $v['R'] ?? ''; $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]['create_time'] = time();
$inserts[$k-2]['update_time'] = time(); $inserts[$k-2]['update_time'] = time();
$inserts[$k-2]['communication_time'] = time(); $inserts[$k-2]['communication_time'] = time();
@ -462,6 +508,7 @@ class SocietyInfoController extends ThinkController
$address=$currentColumn.$currentRow; $address=$currentColumn.$currentRow;
//读取到的数据,保存到数组$arr中 //读取到的数据,保存到数组$arr中
$data[$currentRow][$currentColumn]=$currentSheet->getCell($address)->getValue(); $data[$currentRow][$currentColumn]=$currentSheet->getCell($address)->getValue();
if(is_object($data[$currentRow][$currentColumn])) $data[$currentRow][$currentColumn] = $data[$currentRow][$currentColumn]->__toString();
} }
} }

@ -50,88 +50,83 @@
<tr> <tr>
<td class="l"><span style="color:red">*</span>公司:</td> <td class="l"><span style="color:red">*</span>公司:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="company_name" id="company_name" class="input" placeholder="请输入公司名称"> <input type="text" name="company_name" id="company_name" class="input" placeholder="请输入公司名称" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">注册资本:</td> <td class="l">注册资本:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="register_capital" id="register_capital" class="input" placeholder="请输入注册资本"> <input type="text" name="register_capital" id="register_capital" class="input" placeholder="请输入注册资本" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">负责人:</td> <td class="l">负责人:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="functionary" id="functionary" class="input" placeholder="请输入负责人"> <input type="text" name="functionary" id="functionary" class="input" placeholder="请输入负责人" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">电话:</td> <td class="l">电话:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="phone" id="phone" class="input" placeholder="请输入电话"> <input type="text" name="phone" id="phone" class="input" placeholder="请输入电话" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">微信:</td> <td class="l">微信:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="wechat" id="wechat" class="input" placeholder="请输入微信"> <input type="text" name="wechat" id="wechat" class="input" placeholder="请输入微信" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">QQ</td> <td class="l">QQ</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="qq" id="qq" class="input" placeholder="请输入QQ"> <input type="text" name="qq" id="qq" class="input" placeholder="请输入QQ" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">游戏类型:</td> <td class="l">游戏类型:</td>
<input id="game_type" name="game_type" type="hidden" value="{$game_types[0]['type_name']}"> <input id="game_type" name="game_type" type="hidden" value="{$game_types[0]['type_name']}">
<td class="r" style="width: 50px;"> <td class="r" style="">
<select name="game_type_id" id="game_type_id" class="select_gallery"> <volist name="game_types" id="vo">
<volist name="game_types" id="vo"> <span style="margin-right:18px;">{$vo['type_name']}: <input type="checkbox" name="game_types[]" value="{$vo['type_name']}"></span>
<option value="<?=$vo['id']?>" >{$vo['type_name']}</option> </volist>
</volist>
</select>
<span class="notice-text"></span> <span class="notice-text"></span>
</td> </td>
<script>$("#game_type_id").change(function() {
$("#game_type").val($("#game_type_id option:selected").text());
});</script>
</tr> </tr>
<tr> <tr>
<td class="l">所做游戏:</td> <td class="l">所做游戏:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="game_name" id="game_name" class="input" placeholder="请输入所做游戏"> <input type="text" name="game_name" id="game_name" class="input" placeholder="请输入所做游戏" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">合作平台:</td> <td class="l">合作平台:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="join_platform" id="join_platform" class="input" placeholder="请输入合作平台"> <input type="text" name="join_platform" id="join_platform" class="input" placeholder="请输入合作平台" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">推广规模:</td> <td class="l">推广规模:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="promote_scale" id="promote_scale" class="input" placeholder="请输入推广规模"> <input type="text" name="promote_scale" id="promote_scale" class="input" placeholder="请输入推广规模" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">流水:</td> <td class="l">流水:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="turnover" id="turnover" class="input" placeholder="请输入流水"> <input type="text" name="turnover" id="turnover" class="input" placeholder="请输入流水" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">地址:</td> <td class="l">地址:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="address" id="address" class="input" placeholder="请输入地址"> <input type="text" name="address" id="address" class="input" placeholder="请输入地址" maxlength="100">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">联盟信息:</td> <td class="l">联盟信息:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" name="league_info" id="league_info" class="input" placeholder="请输入联盟信息"> <input type="text" name="league_info" id="league_info" class="input" placeholder="请输入联盟信息" maxlength="50">
</td> </td>
</tr> </tr>
@ -140,10 +135,10 @@
<td class="r table_radio"> <td class="r table_radio">
<span class="form_radio table_btn"> <span class="form_radio table_btn">
<label> <label>
<input type="radio" class="inp_radio" value="0" name="is_potential" checked> <input type="radio" class="inp_radio" value="0" name="is_potential">
</label> </label>
<label> <label>
<input type="radio" class="inp_radio" value="1" name="is_potential" > <input type="radio" class="inp_radio" value="1" name="is_potential" checked>
</label> </label>
</span> </span>
<span class="notice-text"></span> <span class="notice-text"></span>
@ -153,7 +148,7 @@
<tr> <tr>
<td class="l">备注信息:</td> <td class="l">备注信息:</td>
<td class="r"> <td class="r">
<textarea name="remark" class="txt" placeholder="请输入备注信息"></textarea> <textarea name="remark" class="txt" placeholder="请输入备注信息" maxlength="100"></textarea>
</td> </td>
</tr> </tr>
@ -166,7 +161,7 @@
<tr> <tr>
<td class="l">对接人:</td> <td class="l">对接人:</td>
<td class="r"> <td class="r">
<input type="text" class="txt" name="interface_person" value="{$interface_person}" placeholder="对接人"> <input type="text" class="txt" name="interface_person" value="{$interface_person}" placeholder="对接人" maxlength="50">
</td> </td>
</tr> </tr>
@ -176,7 +171,7 @@
</div> </div>
<div class="form-item cf"> <div class="form-item cf">
<input class="submit_btn" type="button" value="保存" id="submit" target-form="form-horizontal" style="margin-left:210px;"> <input class="submit_btn" type="button" value="保存" id="submit" target-form="form-horizontal" style="margin-left:210px;">
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="{:U('Partner/lists')}" > <a class="submit_btn " alt="返回上一页" title="返回上一页" href="{:U('SocietyInfo/lists')}" >
返回 返回
</a> </a>
</div> </div>

@ -51,37 +51,37 @@
<tr> <tr>
<td class="l">公司:</td> <td class="l">公司:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['company_name']}" name="company_name" id="company_name" class="input" placeholder="请输入公司名称"> <input type="text" value="{$data['company_name']}" name="company_name" id="company_name" class="input" placeholder="请输入公司名称" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">注册资本:</td> <td class="l">注册资本:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['register_capital']}" name="register_capital" id="register_capital" class="input" placeholder="请输入注册资本"> <input type="text" value="{$data['register_capital']}" name="register_capital" id="register_capital" class="input" placeholder="请输入注册资本" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">负责人:</td> <td class="l">负责人:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['functionary']}" name="functionary" id="functionary" class="input" placeholder="请输入负责人"> <input type="text" value="{$data['functionary']}" name="functionary" id="functionary" class="input" placeholder="请输入负责人" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">电话:</td> <td class="l">电话:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['phone']}" name="phone" id="phone" class="input" placeholder="请输入电话"> <input type="text" value="{$data['phone']}" name="phone" id="phone" class="input" placeholder="请输入电话" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">微信:</td> <td class="l">微信:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['wechat']}" name="wechat" id="wechat" class="input" placeholder="请输入微信"> <input type="text" value="{$data['wechat']}" name="wechat" id="wechat" class="input" placeholder="请输入微信" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">QQ</td> <td class="l">QQ</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['qq']}" name="qq" id="qq" class="input" placeholder="请输入QQ"> <input type="text" value="{$data['qq']}" name="qq" id="qq" class="input" placeholder="请输入QQ" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
@ -105,37 +105,37 @@
<tr> <tr>
<td class="l">所做游戏:</td> <td class="l">所做游戏:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['game_name']}" name="game_name" id="game_name" class="input" placeholder="请输入所做游戏"> <input type="text" value="{$data['game_name']}" name="game_name" id="game_name" class="input" placeholder="请输入所做游戏" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">合作平台:</td> <td class="l">合作平台:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['join_platform']}" name="join_platform" id="join_platform" class="input" placeholder="请输入合作平台"> <input type="text" value="{$data['join_platform']}" name="join_platform" id="join_platform" class="input" placeholder="请输入合作平台" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">推广规模:</td> <td class="l">推广规模:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['promote_scale']}" name="promote_scale" id="promote_scale" class="input" placeholder="请输入推广规模"> <input type="text" value="{$data['promote_scale']}" name="promote_scale" id="promote_scale" class="input" placeholder="请输入推广规模" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">流水:</td> <td class="l">流水:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['turnover']}" name="turnover" id="turnover" class="input" placeholder="请输入流水"> <input type="text" value="{$data['turnover']}" name="turnover" id="turnover" class="input" placeholder="请输入流水" maxlength="50">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">地址:</td> <td class="l">地址:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['address']}" name="address" id="address" class="input" placeholder="请输入地址"> <input type="text" value="{$data['address']}" name="address" id="address" class="input" placeholder="请输入地址" maxlength="100">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">联盟信息:</td> <td class="l">联盟信息:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" value="{$data['league_info']}" name="league_info" id="league_info" class="input" placeholder="请输入联盟信息"> <input type="text" value="{$data['league_info']}" name="league_info" id="league_info" class="input" placeholder="请输入联盟信息" maxlength="50">
</td> </td>
</tr> </tr>
@ -157,7 +157,7 @@
<tr> <tr>
<td class="l">备注信息:</td> <td class="l">备注信息:</td>
<td class="r"> <td class="r">
<textarea name="remark" class="txt" placeholder="请输入备注信息">{$data['remark']}</textarea> <textarea name="remark" class="txt" placeholder="请输入备注信息" maxlength="100">{$data['remark']}</textarea>
</td> </td>
</tr> </tr>

@ -286,9 +286,27 @@
$(".select_gallery").select2(); $(".select_gallery").select2();
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function mapInit() {
var province = "{:I('get.province')}";
var city = "{:I('get.city')}";
$("#province option").each(function() {
if ($(this).text() == province) {
$(this).attr("selected", "selected");
}
});
$("#city option").each(function() {
if ($(this).text() == city) {
$(this).attr("selected", "selected");
}
});
}
$(function() { $(function() {
areaInit(); areaInit();
provinceChange() mapInit();
provinceChange();
mapInit();
}); });
//导航高亮 //导航高亮
highlight_subnav("{:U('lists')}"); highlight_subnav("{:U('lists')}");

Loading…
Cancel
Save