From 07ee17ca1d71ad958b018df17cd3fdd6d2a2e920 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 7 Jan 2021 11:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E4=BF=A1=E6=81=AF=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SocietyInfoController.class.php | 94 +++++- Application/Admin/View/SocietyInfo/add.html | 14 + Application/Admin/View/SocietyInfo/edit.html | 13 + Application/Admin/View/SocietyInfo/lists.html | 70 +++- Application/Admin/View/SocietyInfo/view.html | 300 ++++++++++++++++++ Data/update.sql | 4 + 6 files changed, 489 insertions(+), 6 deletions(-) create mode 100644 Application/Admin/View/SocietyInfo/view.html diff --git a/Application/Admin/Controller/SocietyInfoController.class.php b/Application/Admin/Controller/SocietyInfoController.class.php index df90c804e..1880870bd 100644 --- a/Application/Admin/Controller/SocietyInfoController.class.php +++ b/Application/Admin/Controller/SocietyInfoController.class.php @@ -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"); diff --git a/Application/Admin/View/SocietyInfo/add.html b/Application/Admin/View/SocietyInfo/add.html index 4148f91cd..d6257700f 100644 --- a/Application/Admin/View/SocietyInfo/add.html +++ b/Application/Admin/View/SocietyInfo/add.html @@ -111,6 +111,20 @@ + + 公会等级: + + + + + + 流水: diff --git a/Application/Admin/View/SocietyInfo/edit.html b/Application/Admin/View/SocietyInfo/edit.html index 48539f364..0f2d6612e 100644 --- a/Application/Admin/View/SocietyInfo/edit.html +++ b/Application/Admin/View/SocietyInfo/edit.html @@ -120,6 +120,19 @@ + + 公会等级: + + + + + 流水: diff --git a/Application/Admin/View/SocietyInfo/lists.html b/Application/Admin/View/SocietyInfo/lists.html index 86f56fdb8..30e46c5fc 100644 --- a/Application/Admin/View/SocietyInfo/lists.html +++ b/Application/Admin/View/SocietyInfo/lists.html @@ -75,6 +75,20 @@ +
+ +
+ +
+   +
+
搜索
@@ -96,6 +110,11 @@ 导出 +
+ + 删除 + +
时间间隔设置 @@ -124,6 +143,8 @@ + + 序号 省份 城市 公司 @@ -136,6 +157,7 @@ 所做游戏 合作平台 推广规模 + 公会等级 流水 地址 联盟信息 @@ -155,10 +177,12 @@ aOh! 暂时还没有内容! - style="background: yellow;" > + + + {$data.num} {$data.province} {$data.city} - {$data.company_name} + {$data.company_name} {$data.register_capital} {$data.functionary} {$data.phone} @@ -168,6 +192,7 @@ {$data.game_name} {$data.join_platform} {$data.promote_scale} + {$data.sociaty_level_str} {$data.turnover} {$data.address} {$data.league_info} @@ -182,7 +207,10 @@ 编辑 - 删除 + 查看 + + 删除 + @@ -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("" + '没有需要删除的数据' + ""); + 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("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + }else{ + layer.msg("" + data.info + ""); + return false; + } + } + }); + }); + + }); + + $(function() { areaInit(); mapInit(); diff --git a/Application/Admin/View/SocietyInfo/view.html b/Application/Admin/View/SocietyInfo/view.html new file mode 100644 index 000000000..04f57c86c --- /dev/null +++ b/Application/Admin/View/SocietyInfo/view.html @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
省份: + + +
城市: + + +
公司: + +
注册资本: + +
负责人: + +
电话: + +
微信: + +
QQ: + +
游戏类型: + + {$vo['type_name']}: checked disabled> + + + +
所做游戏: + +
合作平台: + +
推广规模: + +
公会等级: + + +
流水: + +
地址: + +
联盟信息: + +
是否为意向客户: + + + + + +
备注信息: + +
对接人: + +
+
+ +
+
+
+ + + +
+ + + + + + + + + + diff --git a/Data/update.sql b/Data/update.sql index 308fb3613..e93329e71 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -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 '公会等级 1:S 2:A 3:B 4:其他 ' AFTER `create_account`; \ No newline at end of file