公会信息录入功能添加

master
zhengyongxing 4 years ago
parent 84e1b5c0f3
commit 07ee17ca1d

@ -14,6 +14,13 @@ class SocietyInfoController extends ThinkController
{
private $modelName = 'SocietyInfo';
private $admininfo = '';
private $level = [
0=>'无',
1=>'S',
2=>'A',
3=>'B',
4=>'其他'
];
public function _initialize()
{
@ -32,6 +39,14 @@ class SocietyInfoController extends ThinkController
$map['create_account'] = $this->admininfo['username'];
}
if ($_REQUEST['text']) {
$map['_string'] = "province like '%{$_REQUEST['text']}%' or city like '%{$_REQUEST['text']}%'
or company_name like '%{$_REQUEST['text']}%' or register_capital like '%{$_REQUEST['text']}%' or functionary like '%{$_REQUEST['text']}%'
or phone like '%{$_REQUEST['text']}%' or wechat like '%{$_REQUEST['text']}%' or qq like '%{$_REQUEST['text']}%' or game_type like '%{$_REQUEST['text']}%'
or game_name like '%{$_REQUEST['text']}%' or join_platform like '%{$_REQUEST['text']}%' or promote_scale like '%{$_REQUEST['text']}%' or turnover= '{$_REQUEST['text']}'
or address like '%{$_REQUEST['text']}%' or league_info like '%{$_REQUEST['text']}%' or remark like '%{$_REQUEST['text']}%' or interface_person like '%{$_REQUEST['text']}%'";
}
$page = intval(I('get.p', 0));
$page = $page ? $page : 1; //默认显示第一页数据
$row = intval(I('row', 0));
@ -56,6 +71,7 @@ class SocietyInfoController extends ThinkController
if (I('time_gap', -1) == 0) {
$map['communication_time'] = array('elt', time() - $gap * 86400);
}
if (I('sociaty_level') && I('sociaty_level') != '0') $map['sociaty_level'] = I('sociaty_level');
//获取分页数据
$query = $model->where($map)->order("id desc");
$count = $query->count();
@ -79,6 +95,7 @@ class SocietyInfoController extends ThinkController
return ;
} else {
$societyInfos = $model->where($map)->order("id desc")->field("*")->page($page,$row)->select();
// dump($societyInfos);die();
}
//分页
@ -90,13 +107,25 @@ class SocietyInfoController extends ThinkController
$this->assign('_page', $page);
}
foreach ($societyInfos as &$v) {
foreach ($societyInfos as $k => &$v) {
$v['num'] = $k+1+intval((I('get.p', 0)?I('get.p', 0):1)-1)*$row;
$v['sociaty_level_str'] = $this->level[$v['sociaty_level']];
if (time() - $v['communication_time'] > $gap * 86400)
$v['is_gap_time'] = 1;
}
$this->checkListOrCountAuthRestMap($map,[]);
$this->assign('timeset_check',$this->checkRule("Admin/SocietyInfo/timeset" ,array('in','1,2')));
if (IS_ROOT) {
$this->assign('timeset_check',true);
$this->assign('delset_check',true);
} else {
$this->assign('timeset_check',$this->checkRule("Admin/SocietyInfo/timeset" ,array('in','1,2')));
$this->assign('delset_check',$this->checkRule("Admin/SocietyInfo/delset" ,array('in','1,2')));
}
// $this->assign('time_gap', $config['value']);
$gameTypes = M('game_type', 'tab_')->field("id, type_name")->select();
@ -212,7 +241,6 @@ class SocietyInfoController extends ThinkController
}
$v['partner_info']['company_type'] = $v['partner_info']['company_type'] == 2 ? '个人' : '公司';
$contract_start_time = $v['partner_info']['contract_start_time'] ? time_format($v['partner_info']['contract_start_time'], 'Y/m/d') : '-';
if($v['partner_info']['contract_start_time']){
$contract_end_time = $v['partner_info']['contract_end_time'] ? date('Y/m/d', $v['partner_info']['contract_end_time']) : '永久';
@ -344,6 +372,35 @@ class SocietyInfoController extends ThinkController
}
}
//查看
public function view()
{
$model = M($this->modelName, 'tab_');
$id = intval(I('get.id', 0));
$map['id'] = $id;
$data = $model->find($id);
if (empty($data)) {
$this->error('数据异常', U('lists'));
}
$gameTypes = M('game_type', 'tab_')->field("id, type_name")->select();
$myGameTypes = explode('/', $data['game_type']);
foreach ($gameTypes as &$v) {
$v['check'] = 0;
foreach ($myGameTypes as $item) {
if ($item == $v['type_name']) {
$v['check'] = 1;
}
}
}
$this->assign("game_types", $gameTypes);
$this->assign('data', $data);
$this->meta_title = '编辑';
$this->display();
}
//删除
public function del()
{
@ -371,6 +428,37 @@ class SocietyInfoController extends ThinkController
$this->success('删除成功', U('lists'));
}
//批量删除
public function del_check() {
if (!empty($_POST['ids'])) {
if (!is_array($_POST['ids'])) {
$this->ajaxReturn(['status'=>0,'info'=>'参数异常']);
// $this->error('参数异常');
}
$id = implode(',', $_POST['ids']);
} else {
$id = intval(I('get.id', 0));
if ($id == 0) {
$this->ajaxReturn(['status'=>0,'info'=>'参数异常']);
// $this->error('参数异常');
}
}
$res = M($this->modelName, 'tab_')->delete($id);
if ($res === false) {
// $this->error('删除失败');
$this->ajaxReturn(['status'=>0,'info'=>'删除失败']);
}
addOperationLog(array(
"op_type"=>2,
"key"=>$id,
"url"=>U("Society/lists")
));
$this->ajaxReturn(['status'=>1,'info'=>'删除成功']);
}
// 导入
public function excelImport() {
header("Content-Type:text/html;charset=utf-8");

@ -111,6 +111,20 @@
<input type="text" name="promote_scale" id="promote_scale" class="input" placeholder="请输入推广规模" maxlength="50">
</td>
</tr>
<tr>
<td class="l">公会等级:</td>
<td class="r" style="width: 50px;">
<select name="sociaty_level" id="sociaty_level" class="select_gallery">
<option>请选择公会等级</option>
<option value="1">S</option>
<option value="2">A</option>
<option value="3">B</option>
<option value="4">其他</option>
</select>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<tr>
<td class="l">流水:</td>
<td class="r table_radio">

@ -120,6 +120,19 @@
<input type="text" value="{$data['promote_scale']}" name="promote_scale" id="promote_scale" class="input" placeholder="请输入推广规模" maxlength="50">
</td>
</tr>
<tr>
<td class="l">公会等级:</td>
<td class="r" style="width: 50px;">
<select name="sociaty_level" id="sociaty_level" class="select_gallery">
<option>请选择公会等级</option>
<option value="1" <if condition="$data['sociaty_level'] eq 1">selected</if>>S</option>
<option value="2" <if condition="$data['sociaty_level'] eq 2">selected</if>>A</option>
<option value="3" <if condition="$data['sociaty_level'] eq 3">selected</if>>B</option>
<option value="4" <if condition="$data['sociaty_level'] eq 4">selected</if>>其他</option>
</select>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">流水:</td>
<td class="r table_radio">

@ -75,6 +75,20 @@
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select name="sociaty_level" id="sociaty_level" class="select_gallery">
<option value="0">请选择公会等级</option>
<option value="1">S</option>
<option value="2">A</option>
<option value="3">B</option>
<option value="4">其他</option>
</select>
</div>
<div class="input-list">
<input type="text" name="text" style="width: 200px" class="" placeholder="快速搜索" value="{:I('text')}"/>&nbsp;
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
@ -96,6 +110,11 @@
<a class="sch-btn" href="javascript:;" id="downloadexcel" url="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出</a>
</if>
</div>
<div class="input-list">
<if condition="$delset_check eq true ">
<a class="sch-btn" id="del_check" style="background:red">删除</a>
</if>
</div>
<div class="input-list">
<if condition="$timeset_check eq true ">
<a style="width: 100px;" class="sch-btn" href="javascript:;" id="timeset" data-url="{:U('timeset')}">时间间隔设置</a>
@ -124,6 +143,8 @@
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th>序号</th>
<th>省份</th>
<th>城市</th>
<th>公司</th>
@ -136,6 +157,7 @@
<th>所做游戏</th>
<th>合作平台</th>
<th>推广规模</th>
<th>公会等级</th>
<th>流水</th>
<th>地址</th>
<th>联盟信息</th>
@ -155,10 +177,12 @@
<td colspan="22" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="listData" id="data">
<tr <if condition="$data['is_gap_time'] eq 1"> style="background: yellow;" </if> >
<tr >
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td rowspan="{$data.row}">{$data.num}</td>
<td rowspan="{$data.row}">{$data.province}</td>
<td rowspan="{$data.row}">{$data.city}</td>
<td rowspan="{$data.row}">{$data.company_name}</td>
<td rowspan="{$data.row}"><if condition="$data['is_gap_time'] eq 1"> <span style="color: red"></span> </if>{$data.company_name}</td>
<td rowspan="{$data.row}">{$data.register_capital}</td>
<td rowspan="{$data.row}">{$data.functionary}</td>
<td rowspan="{$data.row}">{$data.phone}</td>
@ -168,6 +192,7 @@
<td rowspan="{$data.row}">{$data.game_name}</td>
<td rowspan="{$data.row}">{$data.join_platform}</td>
<td rowspan="{$data.row}">{$data.promote_scale}</td>
<td rowspan="{$data.row}">{$data.sociaty_level_str}</td>
<td rowspan="{$data.row}">{$data.turnover}</td>
<td rowspan="{$data.row}">{$data.address}</td>
<td rowspan="{$data.row}">{$data.league_info}</td>
@ -182,7 +207,10 @@
<td rowspan="{$data.row}">
<a href="{:U('edit',array('id'=>$data['id']))}">编辑</a>
<a href="{:U('del',array('id'=>$data['id']))}" class="confirm ajax-get">删除</a>
<a href="{:U('view',array('id'=>$data['id']))}">查看</a>
<if condition="$delset_check eq true ">
<a href="{:U('del',array('id'=>$data['id']))}" class="confirm ajax-get">删除</a>
</if>
</td>
</tr>
@ -302,6 +330,42 @@
});
}
$("#del_check").click(function () {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>" + '没有需要删除的数据' + "</font>");
return;
}
layer.confirm('删除后将无法恢复,请慎重选择', {
btn: ['确认','取消'],
title:false
}, function(){
$.ajax({
type: "POST",
url: "{:U('del_check')}",
dataType: 'json',
async: false,
data: {ids:text},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
});
});
$(function() {
areaInit();
mapInit();

@ -0,0 +1,300 @@
<extend name="Public/base" />
<block name="css">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
.tabcon1711 td:first-child{width: 20px; padding-left: 20px;}
</style>
</block>
<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script src="__STATIC__/md5.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/area.js" type="text/javascript" charset="utf-8"></script>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
</div>
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('edit')}" method="post" class="form-horizontal" autocomplete="off">
<input value="{$data['id']}" name="id" type="hidden">
<!-- 基础 -->
<div id="tab1" class="tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">省份:</td>
<td class="r" style="width: 50px;">
<select name="province" id="province" class="select_gallery" disabled>
</select>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">城市:</td>
<td class="r" style="width: 50px;">
<select name="city" id="city" class="select_gallery" disabled>
</select>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">公司:</td>
<td class="r table_radio">
<input type="text" value="{$data['company_name']}" name="company_name" id="company_name" class="input" placeholder="请输入公司名称" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">注册资本:</td>
<td class="r table_radio">
<input type="text" value="{$data['register_capital']}" name="register_capital" id="register_capital" class="input" placeholder="请输入注册资本" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">负责人:</td>
<td class="r table_radio">
<input type="text" value="{$data['functionary']}" name="functionary" id="functionary" class="input" placeholder="请输入负责人" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">电话:</td>
<td class="r table_radio">
<input type="text" value="{$data['phone']}" name="phone" id="phone" class="input" placeholder="请输入电话" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">微信:</td>
<td class="r table_radio">
<input type="text" value="{$data['wechat']}" name="wechat" id="wechat" class="input" placeholder="请输入微信" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">QQ</td>
<td class="r table_radio">
<input type="text" value="{$data['qq']}" name="qq" id="qq" class="input" placeholder="请输入QQ" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">游戏类型:</td>
<!--<input id="game_type" name="game_type" type="hidden" value="{$game_types[0]['type_name']}">-->
<td class="r" style="">
<volist name="game_types" id="vo">
<span style="margin-right:18px;">{$vo['type_name']}: <input type="checkbox" name="game_types[]" value="{$vo['type_name']}" <if condition="$vo['check'] eq 1">checked</if> disabled></span>
</volist>
<!--<select name="game_type_id" id="game_type_id" class="select_gallery">
<volist name="game_types" id="vo">
<option value="<?=$vo['id']?>" <if condition="$data['game_type_id'] eq $vo['id']">selected</if> >{$vo['type_name']}</option>
</volist>
</select>-->
<span class="notice-text"></span>
</td>
<!--<script>$("#game_type_id").change(function() {
$("#game_type").val($("#game_type_id option:selected").text());
});</script>-->
</tr>
<tr>
<td class="l">所做游戏:</td>
<td class="r table_radio">
<input type="text" value="{$data['game_name']}" name="game_name" id="game_name" class="input" placeholder="请输入所做游戏" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">合作平台:</td>
<td class="r table_radio">
<input type="text" value="{$data['join_platform']}" name="join_platform" id="join_platform" class="input" placeholder="请输入合作平台" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">推广规模:</td>
<td class="r table_radio">
<input type="text" value="{$data['promote_scale']}" name="promote_scale" id="promote_scale" class="input" placeholder="请输入推广规模" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">公会等级:</td>
<td class="r" style="width: 50px;">
<select name="sociaty_level" id="sociaty_level" class="select_gallery" disabled>
<option>请选择公会等级</option>
<option value="1" <if condition="$data['sociaty_level'] eq 1">selected</if>>S</option>
<option value="2" <if condition="$data['sociaty_level'] eq 2">selected</if>>A</option>
<option value="3" <if condition="$data['sociaty_level'] eq 3">selected</if>>B</option>
<option value="4" <if condition="$data['sociaty_level'] eq 4">selected</if>>其他</option>
</select>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">流水:</td>
<td class="r table_radio">
<input type="text" value="{$data['turnover']}" name="turnover" id="turnover" class="input" placeholder="请输入流水" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l">地址:</td>
<td class="r table_radio">
<input type="text" value="{$data['address']}" name="address" id="address" class="input" placeholder="请输入地址" maxlength="100" disabled>
</td>
</tr>
<tr>
<td class="l">联盟信息:</td>
<td class="r table_radio">
<input type="text" value="{$data['league_info']}" name="league_info" id="league_info" class="input" placeholder="请输入联盟信息" maxlength="50" disabled>
</td>
</tr>
<tr>
<td class="l noticeinfo">是否为意向客户:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="0" name="is_potential" <if condition="$data['is_potential'] eq 0">checked</if> disabled> 否
</label>
<label>
<input type="radio" class="inp_radio" value="1" name="is_potential" <if condition="$data['is_potential'] eq 1">checked</if> disabled> 是
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">备注信息:</td>
<td class="r">
<textarea name="remark" class="txt" placeholder="请输入备注信息" maxlength="100" disabled>{$data['remark']}</textarea>
</td>
</tr>
<!--<tr>
<td class="l">沟通时间:</td>
<td class="r">
<input type="text" class="txt time time1" name="communication_time" value="" placeholder="请选择沟通时间">
</td>
</tr>-->
<tr>
<td class="l">对接人:</td>
<td class="r">
<input type="text" class="txt" name="interface_person" value="{$data['interface_person']}" placeholder="对接人" disabled>
</td>
</tr>
</tbody>
</table>
</div>
<div class="form-item cf">
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="{:U('SocietyInfo/lists')}" >
返回
</a>
</div>
</form>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$meta_title}">
<input type="hidden" name="url" value="SocietyInfo/add">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
$(function() {
areaInit();
var province = document.getElementById('province');
//给选择框一个高度可直接写进数据不然要先创建dom元素option再录值
province.length=provinces.length;
for(var i=0;i<provinces.length;i++){
if (province.options[i].text == "{$data['province']}"
|| province.options[i].text.substring(0, 2) == "{$data['province']}".substring(0, 2)
) {
province.selectedIndex = province.options[i].index;
province.options[i].selected = true;
$("#province").change();
break;
}
}
var city = document.getElementById('city');
city.length=citys.length;
for(var i=0;i<citys.length;i++){
if (city.options[i].text == "{$data['city']}"
|| city.options[i].text.substring(0, 2) == "{$data['city']}".substring(0, 2)
) {
city.selectedIndex = city.options[i].index;
city.options[i].selected = true;
break;
}
}
});
$('.time1').datetimepicker({
format: 'yyyy-mm-dd H:i:0',
language:"zh-CN",
minView: 0,
autoclose:true,
showClear: true,
});
//导航高亮
highlight_subnav("{:U('SocietyInfo/lists')}");
</script>
<script>
$("#submit").on("click",function(){
var cres = $('form').serializeArray();
if ($("#province").val() == "请选择省份" || !$("#province").val()) {
// layer.msg('请选择省份');return ;
}
if (!$("#city").val()) {
// layer.msg('请选择城市');return ;
}
if (!$("#company_name").val()) {
layer.msg('请输入公司名');return ;
}
//添加
$.ajax({
url:"{:U('SocietyInfo/edit')}",
type:"post",
data:cres,
dataType:"json",
success:function(data){
if(data.status == 1){
layer.msg(data.info,function(){
window.location.href="{:U('SocietyInfo/lists')}";
});
}else{
layer.msg(data.info);
}
},
error:function(e){
}
});
});
</script>
</block>

@ -2781,3 +2781,7 @@ ALTER TABLE `tab_testing_resource_batch`
ADD COLUMN `verify_admin_id` int(11) NOT NULL DEFAULT 0 COMMENT '審核管理員ID' AFTER `verify_status`;
ALTER TABLE `tab_testing_resource_batch`
ADD COLUMN `apply_admin_id` int(11) NOT NULL DEFAULT 0 COMMENT '申請管理員ID' AFTER `apply_promote_id`;
ALTER TABLE `tab_society_info`
ADD COLUMN `sociaty_level` tinyint(2) NOT NULL DEFAULT 0 COMMENT '公会等级 1S 2A 3B 4其他 ' AFTER `create_account`;
Loading…
Cancel
Save