diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 1fe22c5d8..1cc6d854c 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -19,47 +19,178 @@ class PromoteCompanyController extends ThinkController public function lists() { $model = M($this->modelName, 'tab_'); + $is_export= false; + if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ + $is_export = true; + } $map = []; - $id = intval(I('id', 0)); + $promotemap=[]; $company_name = trim(I('company_name')); - if (!empty($id)) { - $map['tab_promote_company.id'] = $id; - $parameter['id'] = $id; - } - if($company_name) - $map['tab_promote_company.company_name'] = array('like',"%{$company_name}%"); + if($company_name) $map['tab_promote_company.company_name'] = array('like',"%{$company_name}%"); if (isset($_REQUEST['status']) && $_REQUEST['status'] !== '') { $status = intval($_REQUEST['status']); $map['tab_promote_company.status'] = $status; $parameter['status'] = $status; } + if (isset($_REQUEST['promote_id'])) { + $map['id'] = M("Promote","tab_")->field("company_id")->where("id={$_REQUEST['promote_id']}")->find()['company_id']; + $promotemap['id']=$_REQUEST['promote_id']; + } + if (isset($_REQUEST['company_type'])) { + $map['company_type'] = $_REQUEST['company_type']; + } + $page = intval(I('get.p', 0)); $page = $page ? $page : 1; //默认显示第一页数据 $row = intval(I('row', 0)); $row = empty($row) ? 10 : $row;//每页条数 - $data = $model - ->field('tab_promote_company.id,tab_promote_company.company_name,tab_promote_company.status, - tab_promote_company.create_time,sys_member.nickname') - ->join('left join sys_member on sys_member.uid = tab_promote_company.uid') - ->where($map) - ->order('id desc') - ->page($page, $row) - ->select(); + //获取分页公司数据 + $companyres = $model->field("*") + ->where($map) + ->order("last_up_time desc"); + if($is_export){ + $companyres = $companyres->select(); + }else{ + $companyres = $companyres->page($page,$row)->select(); + } + //获取公司id + $companyids = implode(',', array_column($companyres, 'id')); + //获取所属会长及其游戏分成 + $promotemap['company_id']=["in",$companyids]; + $promoteres = M("Promote","tab_") + ->field("id,company_id,account,settlement_type") + ->where($promotemap) + ->select(); + //获取会长id + $promoteids = implode(',', array_column($promoteres, 'id')); + //获取游戏比例 + $gameradiores = M("PromoteGameRatio","tab_") + ->alias("pg") + ->field("pg.ratio,pg.relation_game_id,pg.turnover_ratio,pg.game_id,pg.promote_id,ga.relation_game_name,ga.game_type_name") + ->join("tab_game ga ON pg.game_id = ga.id") + ->where(array( + "status"=>1, + "promote_id"=>["in",$promoteids] + )) + ->group("relation_game_id,promote_id") + ->select(); + //比例数据处理 + $gameradiotemp = array(); + foreach($gameradiores as $k=>$v){ + $turnover_ratio = json_decode($v['turnover_ratio'],true); + $v['turnover_ratio'] = array( + array("ratio"=>$v['ratio']."%","name"=>"默认比例") + ); + + foreach($turnover_ratio as $ke=>$va){ + $t=array("ratio"=>$va["ratio"]."%"); + if(array_key_exists("instanceof",$va)){ + //存在 + if($va['instanceof']=='1'){ + $t['name']="月流水≥".$va['turnover']; + }else{ + $t['name']="月流水>".$va['turnover']; + } + }else{ + $t['name']="月流水≥".$va['turnover']; + } + $v['turnover_ratio'][]=$t; + } + $v['row'] = count($v['turnover_ratio']); + unset($v["ratio"]); + unset($v["relation_game_id"]); + unset($v["game_id"]); + $gameradiotemp[$v['promote_id']][]=$v; + } + unset($gameradiores); + //会长数据处理 + $promoterestemp=[]; + foreach($promoteres as $k=>$v){ + if(array_key_exists($v['id'],$gameradiotemp)){ + //存在 + $v['list'] = $gameradiotemp[$v['id']]; + foreach($gameradiotemp[$v['id']] as $ke=>$va){ + $v['row'] += $va['row']; + } + }else{ + $v['list']=[ + ["relation_game_name"=>"--","game_type_name"=>"--", + "turnover_ratio"=>[ + ["name"=>"--","ratio"=>"--"] + ], + "row"=>1 + ] + ]; + $v["row"]=1; + } + if($v['settlement_type'] == 1){ + $v['settlement_type']="周结"; + }else{ + $v['settlement_type']="月结"; + } + $promoterestemp[$v['company_id']]["list"][]=$v; + } + unset($promoteres); + //处理公司数据 + foreach($companyres as $k=>&$v){ + if(array_key_exists($v['id'],$promoterestemp)){ + //存在 + $v['list'] = $promoterestemp[$v['id']]['list']; + foreach($promoterestemp[$v['id']] as $ke=>$va){ + foreach($va as $key=>$val){ + $v['row'] += $val['row']; + } + + } + }else{ + //空值 + $v['list']=[ + [ + "account"=>"--", + "settlement_type"=>"--", + 'list'=>[ + [ + "relation_game_name"=>"--", + "game_type_name"=>"--", + "turnover_ratio"=>[ + ["name"=>"--","ratio"=>"--"] + ], + "row"=>1 + ] + ] + ] + ]; + $v['row'] += 1; + } + if( $v["contact_begin"] >0 ){ + $v["contact_begin"] = date('Y/m/d', $v["contact_begin"]); + }else{ + $v["contact_begin"] = "--"; + } + if( $v["contact_end"] > 0){ + $v["contact_end"] = date('Y/m/d', $v["contact_end"]); + }else{ + $v["contact_end"] = "--"; + } + if($v['platform_name'] == '' || $v['platform_name'] == "0"){ + $v['platform_name'] = "--"; + } + $v["is_sign_contact"] = ($v["is_sign_contact"]=="1" ? "是" :'否'); + + } + // dd($companyres); + if($is_export){ + $this->assign('listData', $companyres); + $this->display("export"); + die(); + } /* 查询记录总数 */ $count = $model ->where($map) ->count(); - - if (!empty($data)) { - foreach ($data as &$list) { - $list['status'] = ($list['status'] == 0) ? '已关闭' : '已开启'; - $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']); - } - } - //分页 $parameter['p'] = $page; $parameter['row'] = $row; @@ -68,8 +199,9 @@ class PromoteCompanyController extends ThinkController $this->assign('_page', $page); } - $this->assign('listData', $data); + $this->assign('listData', $companyres); $this->assign('count', $count); + $this->assign('promoteList', getPromoteByLevel(1)); $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/lists'])->find()); $this->meta_title = '推广公司'; $this->display(); @@ -80,77 +212,38 @@ class PromoteCompanyController extends ThinkController { if ($_POST) { $company_name = I('post.company_name', ''); - $status = intval(I('post.status', 1)); - - if (empty($company_name)) { - $this->error('请输入推广公司名称'); - } - if (empty(I('post.settlement_contact'))) { - $this->error('请输入结算联系人'); - } - if (empty(I('post.contact_phone'))) { - $this->error('请输入联系人电话'); - } - $pattern = "/^1[3|5|7|8]\\d{9}$/i"; - if(!preg_match($pattern, I('post.contact_phone'))) { - $this->error("手机号码格式不合法"); - return false; - } - if (empty(I('post.address'))) { - $this->error('请输入所在地址'); - } - if (empty(I('post.bank_card'))) { - $this->error('请输入银行卡号'); - } - $bank_card_pattern = "/^\d{10,19}$/u"; - if (!preg_match($bank_card_pattern, I('post.bank_card'))) { - $this->error('卡号格式错误'); - return false; - } - if (empty(I('post.bank_cardname'))) { - $this->error('请输入银行卡名'); - } - if (empty(I('post.bank_name'))) { - $this->error('请输入收款银行'); - } - if (empty(I('post.bank_address'))) { - $this->error('请输入开户网点'); - } - if (!in_array($status, [0, 1])) { - $this->error('参数异常'); - } - - if (!empty(I('post.content'))) { - $save['content'] = I('post.content'); - } - $model = M($this->modelName, 'tab_'); $map['company_name'] = $company_name; $res = $model->where($map)->getField('id'); if ($res) { - $this->error('推广公司已存在'); + $this->ajaxReturn(array( + 'status' => 0, + 'info' => "推广公司已经存在" + )); } - $time = time(); - $save['company_name'] = $company_name; - $save['status'] = $status; - $save['uid'] = UID; + $save = I('post.');//前端已经验证 $save['create_time'] = $time; $save['last_up_time'] = $time; - $save['settlement_contact'] = I('post.settlement_contact'); - $save['contact_phone'] = I('post.contact_phone'); - $save['address'] = I('post.address'); - $save['bank_card'] = I('post.bank_card'); - $save['bank_cardname'] = I('post.bank_cardname'); - $save['bank_name'] = I('post.bank_name'); - $save['bank_address'] = I('post.bank_address'); - + $save['contact_begin']=strtotime($save['contact_begin']); + $save['contact_end']=strtotime($save['contact_end']); + + if(isset($save['resources'])){ + $save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE); + } $res = $model->add($save); if ($res) { \Think\Log::actionLog('PromoteCompany/add', 'partner', $res); - $this->success('保存成功', U('lists')); + $array=array( + "info"=>"添加成功", + "status"=>1 + ); + $this->ajaxReturn($array); } else { - $this->error('保存失败'); + $this->ajaxReturn(array( + 'status' => 0, + 'info' => "保存失败" + )); } } else { $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCompany/add'])->find()); @@ -158,6 +251,33 @@ class PromoteCompanyController extends ThinkController $this->display(); } } + //查看 + public function view() + { + $model = M($this->modelName, 'tab_'); + $id = $_REQUEST['id'] ?: 0; + $map['id'] = $id; + $data = $model->field('*')->find($id); + if (empty($data)) { + $this->error('数据异常', U('lists')); + } + if($data['contact_begin'] >0){ + $data['contact_begin']=date("Y-m-d",$data['contact_begin']); + }else{ + $data['contact_begin']=''; + } + if($data['contact_end'] >0){ + $data['contact_end']=date("Y-m-d",$data['contact_end']); + }else{ + $data['contact_end']=''; + } + if($data['resources'] == ''){ + $data['resources'] ="[]"; + } + $this->assign('data', $data); + $this->display(); + } + //编辑 public function edit() @@ -165,92 +285,52 @@ class PromoteCompanyController extends ThinkController $model = M($this->modelName, 'tab_'); if ($_POST) { - $company_name = I('post.company_name', ''); - $status = intval(I('post.status', 1)); - $id = intval(I('post.id', 0)); - - if (empty($company_name)) { - $this->error('请输入推广公司名称'); - } - if (empty(I('post.settlement_contact'))) { - $this->error('请输入结算联系人'); - } - if (empty(I('post.contact_phone'))) { - $this->error('请输入联系人电话'); - } - $pattern = "/^1[3|5|7|8]\\d{9}$/i"; - if(!preg_match($pattern, I('post.contact_phone'))) { - $this->error("手机号码格式不合法"); - return false; - } - if (empty(I('post.address'))) { - $this->error('请输入所在地址'); - } - if (empty(I('post.bank_card'))) { - $this->error('请输入银行卡号'); - } - $bank_card_pattern = "/^\d{10,19}$/u"; - if (!preg_match($bank_card_pattern, I('post.bank_card'))) { - $this->error('卡号格式错误'); - return false; - } - if (empty(I('post.bank_cardname'))) { - $this->error('请输入银行卡名'); - } - if (empty(I('post.bank_name'))) { - $this->error('请输入收款银行'); - } - if (empty(I('post.bank_address'))) { - $this->error('请输入开户网点'); - } - if (!in_array($status, [0, 1]) || $id == 0) { - $this->error('参数异常'); - } - if (!empty(I('post.content'))) { - $save['content'] = I('post.content'); - } - $data = $model->field('id,company_name')->find($id); - if (empty($data)) { - $this->error('数据异常'); - } - - $map['company_name'] = $company_name; - $res = $model->where($map)->getField('id'); - if ($res && $res != $id) { - $this->error('推广公司已存在'); - } - $time = time(); - $save['id'] = $id; - $save['company_name'] = $company_name; - $save['status'] = $status; + $save = I('post.');//前端已经验证 + $save['create_time'] = $time; $save['last_up_time'] = $time; - $save['settlement_contact'] = I('post.settlement_contact'); - $save['contact_phone'] = I('post.contact_phone'); - $save['address'] = I('post.address'); - $save['bank_card'] = I('post.bank_card'); - $save['bank_cardname'] = I('post.bank_cardname'); - $save['bank_name'] = I('post.bank_name'); - $save['bank_address'] = I('post.bank_address'); - + $save['contact_begin']=strtotime($save['contact_begin']); + $save['contact_end']=strtotime($save['contact_end']); + + if(isset($save['resources'])){ + $save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE); + } $res = $model->save($save); - if ($res === false) { - $this->error('保存失败'); + if ($res) { + \Think\Log::actionLog('PromoteCompany/edit', 'partner', $res); + $array=array( + "info"=>"修改成功", + "status"=>1 + ); + $this->ajaxReturn($array); } else { - \Think\Log::actionLog('PromoteCompany/edit', 'PromoteCompany', $id); - $this->success('保存成功', U('lists')); + $this->ajaxReturn(array( + 'status' => 0, + 'info' => "修改失败" + )); } } else { - $id = intval(I('get.id', 0)); + $id = $_REQUEST['id'] ?: 0; $map['id'] = $id; - $data = $model->field('id,company_name,status,settlement_contact,contact_phone,address,bank_card,bank_cardname,bank_name,bank_address,content')->find($id); + $data = $model->field('*')->find($id); if (empty($data)) { $this->error('数据异常', U('lists')); } - + if($data['contact_begin'] >0){ + $data['contact_begin']=date("Y-m-d",$data['contact_begin']); + }else{ + $data['contact_begin']=''; + } + if($data['contact_end'] >0){ + $data['contact_end']=date("Y-m-d",$data['contact_end']); + }else{ + $data['contact_end']=''; + } + if($data['resources'] == ''){ + $data['resources'] ="[]"; + } + $this->assign('data', $data); - $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCompany/edit'])->find()); - $this->meta_title = '编辑推广公司'; $this->display(); } } @@ -258,24 +338,92 @@ class PromoteCompanyController extends ThinkController //删除 public function del() { - if (!empty($_POST['ids'])) { - if (!is_array($_POST['ids'])) { + $model = M($this->modelName, 'tab_'); + if (!empty($_POST['id'])) { + if (!is_array($_POST['id'])) { $this->error('参数异常'); } - $id = implode(',', $_POST['ids']); + $id = $_POST['id']; } else { $id = intval(I('get.id', 0)); if ($id == 0) { $this->error('参数异常'); } } - - $res = M($this->modelName, 'tab_')->delete($id); + //删除所有资源 + $data = $model->field('resources')->find($id)['resources']; + $data = json_encode($data,true); + if(is_array($data) && count($data) >0){ + foreach($data as $k=>$v){ + unlink("./".$v['file_path']); + } + } + $res = $model->delete($id); + //删除对应的推广员 if ($res === false) { $this->error('删除失败'); } $this->success('删除成功', U('lists')); } + //处理上传图片 + public function saveFile() + { + $path = '/Uploads/'; + $upload = new \Think\Upload();// 实例化上传类 + $upload->maxSize = 0 ;// 设置附件上传大小 + $upload->exts = '';// 设置附件上传类型 + $upload->rootPath = '.'.$path; // 设置附件上传根目录 + $upload->savePath = ''; // 设置附件上传(子)目录 + // 上传文件 + $info = $upload->upload(); + // dump($info); + if(!$info) {// 上传错误提示错误信息 + $msg = $upload->getError(); + $array= array('status' => 0, 'info' => $msg); + }else{// 上传成功 + $array=array( + "info"=>"上传成功", + "status"=>1, + "file_path"=>$path.$info['file']['savepath'].$info['file']['savename'], + "file_name"=>$_POST['file_name'], + "file_type"=>$_FILES['file']['type'], + "file_size"=>$_FILES['file']['size'], + "upload_time"=>date("Y-m-d H:i:s",time()) + ); + } + $this->ajaxReturn($array); + } + //删除图片 + public function delFile() + { + $id = $_REQUEST['id']; + $file_path = $_REQUEST['file_path'] ?: false; + unlink("./".$file_path); + if($id == 0){ + $this->ajaxReturn(array( + 'status' => 1, + 'info' => "删除成功" + )); + }else{ + //需要修改 + $array = array( + "resources"=>json_encode($_REQUEST['resources'],JSON_UNESCAPED_UNICODE) + ); + $res = M($this->modelName, 'tab_')->where("id='{$id}'")->save($array); + if($res === false){ + $this->ajaxReturn(array( + 'status' => 0, + 'info' => "删除保存失败" + )); + }else{ + $this->ajaxReturn(array( + 'status' => 1, + 'info' => "删除成功" + )); + } + } + # code... + } } diff --git a/Application/Admin/View/PromoteCompany/add.html b/Application/Admin/View/PromoteCompany/add.html index 0d2b420ed..7c71459f6 100644 --- a/Application/Admin/View/PromoteCompany/add.html +++ b/Application/Admin/View/PromoteCompany/add.html @@ -2,6 +2,8 @@ + +
@@ -24,7 +42,7 @@
-
+
@@ -35,6 +53,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + +
对应平台(简称): + +
合同期限: +
+ +  -  +
+ + +
+
+
开票税点: + + % +
*公司性质: +
+ +
+
*是否签署合同: +
+ +
+
*团体归属: +
+ +
+
*联系结算人: @@ -59,12 +144,12 @@
*收款银行: @@ -97,18 +182,30 @@
文档管理 +
+ 添加 +
+
+ + +
-
- 返回
-
+
@@ -119,7 +216,29 @@ 已添加添加至常用设置
+
@@ -130,4 +249,137 @@ $('#form').submit(); }); + diff --git a/Application/Admin/View/PromoteCompany/addfile.html b/Application/Admin/View/PromoteCompany/addfile.html new file mode 100644 index 000000000..d7ca9a58b --- /dev/null +++ b/Application/Admin/View/PromoteCompany/addfile.html @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
文件名称: + +
文件选择: + +
+
+
+
确认添加
+
+
+
+ + + + + diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index b064668ed..015297b55 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -2,6 +2,8 @@ + +
-
+
@@ -35,6 +53,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + +
对应平台(简称): + +
合同期限: +
+ +  -  +
+ + +
+
+
开票税点: + + % +
*公司性质: +
+ +
+
*是否签署合同: +
+ +
+
*团体归属: +
+ +
+
*联系结算人: @@ -59,12 +152,12 @@
*收款银行: @@ -88,49 +181,235 @@
文档管理 +
+ 添加 +
+ + * 新增加文档需要保存修改后生效,删除文档即时生效(取消保存修改也生效,请慎重删除) + +
+ + +
-
- - - + 返回
-
+
- +
已添加添加至常用设置
+
+ diff --git a/Application/Admin/View/PromoteCompany/export.html b/Application/Admin/View/PromoteCompany/export.html new file mode 100644 index 000000000..b359b2ad2 --- /dev/null +++ b/Application/Admin/View/PromoteCompany/export.html @@ -0,0 +1,178 @@ + + + + + + 游戏登陆列表|----软件管理平台 + + + + + + + + + + + +
+ 导出进行中。。。
+ 如果导出成功你也可以手动关闭此页面 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
合作方名称对应平台合同期限开票税点开户行银行账号是否签署合同备注会长账号结算周期产品类型游戏名称合作方分成比例
aOh! 暂时还没有内容!
{$data.company_name}{$data.platform_name}{$data.contact_begin} - {$data.contact_end}{$data.fax_ratio}%{$data.bank_name}{$data.bank_card}{$data.is_sign_contact}{$data.content}
{$promote['account']} {$promote['settlement_type']}
{$game['game_type_name']}{$game['relation_game_name']}
{$ratio['name']}{$ratio['ratio']}
{$ratio['name']}{$ratio['ratio']}
{$game['game_type_name']}{$game['relation_game_name']}
{$ratio['name']}{$ratio['ratio']}
{$ratio['name']}{$ratio['ratio']}
{$promote['account']} {$promote['settlement_type']}{$game['game_type_name']}{$game['relation_game_name']}
{$ratio['name']}{$ratio['ratio']}
{$ratio['name']}{$ratio['ratio']}
{$game['game_type_name']}{$game['relation_game_name']}
{$ratio['name']}{$ratio['ratio']}
{$ratio['name']}{$ratio['ratio']}
+ + + + + diff --git a/Application/Admin/View/PromoteCompany/lists.html b/Application/Admin/View/PromoteCompany/lists.html index d80bc3e38..9b4d36746 100644 --- a/Application/Admin/View/PromoteCompany/lists.html +++ b/Application/Admin/View/PromoteCompany/lists.html @@ -29,28 +29,56 @@ .data_list table td{ text-indent:0; } + .data_game_list table td{ + line-height:1; + padding: 3px; + } - +
+
-
-
- -
-
- - 搜索 +
+ + +
+
+   +
+ +
+ +
+
+ +
+ +
+ 搜索 +
+
@@ -58,37 +86,127 @@
- +
- - - - - + + + + + + + + + + + + + + - + - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -100,14 +218,14 @@ {$_page|default=''} -
+ @@ -151,6 +269,19 @@ window.location.href = url; }); + $("#downloadexcel").on("click",function(){ + var url = $(this).attr("url"); + var title = '推广公司导出'; + layer.open({ + type: 2, + title: title, + shadeClose: true, + shade: 0.8, + area: ['40%', '60%'], + content: url + + }); + }) //回车自动提交 $('.jssearch').find('input').keyup(function(event){ diff --git a/Application/Admin/View/PromoteCompany/view.html b/Application/Admin/View/PromoteCompany/view.html new file mode 100644 index 000000000..8b16d5be3 --- /dev/null +++ b/Application/Admin/View/PromoteCompany/view.html @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +
+
- - 推广公司显示状态添加人添加时间 操作合作方名称对应平台合同期限开票税点开户行银行账号是否签署合同备注会长账号结算周期产品类型游戏名称合作方分成比例
aOh! 暂时还没有内容!aOh! 暂时还没有内容!
{$data.company_name}{$data.status}{$data.nickname}{$data.create_time} + + 查看 编辑 - 删除 + 删除 {$data.company_name}{$data.platform_name}{$data.contact_begin} - {$data.contact_end}{$data.fax_ratio}%{$data.bank_name}{$data.bank_card}{$data.is_sign_contact}{$data.content}
{$promote['account']} {$promote['settlement_type']}
{$game['game_type_name']}{$game['relation_game_name']}
{$ratio['name']}{$ratio['ratio']}
{$ratio['name']}{$ratio['ratio']}
{$game['game_type_name']}{$game['relation_game_name']}
{$ratio['name']}{$ratio['ratio']}
{$ratio['name']}{$ratio['ratio']}
{$promote['account']} {$promote['settlement_type']}{$game['game_type_name']}{$game['relation_game_name']}
{$ratio['name']}{$ratio['ratio']}
{$ratio['name']}{$ratio['ratio']}
{$game['game_type_name']}{$game['relation_game_name']}
{$ratio['name']}{$ratio['ratio']}
{$ratio['name']}{$ratio['ratio']}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
推广公司名称: + +
对应平台(简称): + +
合同期限: +
+ +  -  +
+ + +
+
+
开票税点: + + % +
公司性质: +
+ +
+
是否签署合同: +
+ +
+
团体归属: +
+ +
+
联系结算人: + +
联系电话: + +
所在地址: + +
银行卡号: + +
收款银行: + +
开户网点: + +
备注: + +
显示状态: + + + + + +
+ + +
+
+
+
+
+ + + + + + + + diff --git a/Data/update.sql b/Data/update.sql index 9779a350d..69eb15842 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1226,3 +1226,14 @@ ADD COLUMN `file_info` text COMMENT '文档信息,json格式'; ALTER TABLE tab_partner ADD COLUMN `company_type` TINYINT (3) NOT NULL DEFAULT '1' COMMENT '公司性质:1-公司 2-个人'; + +--2020-02-11 chenzhi 推广公司录入主体信息增加-- +ALTER TABLE `tab_promote_company` + ADD COLUMN `platform_name` VARCHAR(60) NOT NULL DEFAULT '' COMMENT '平台名称' AFTER `bank_address`, + ADD COLUMN `contact_begin` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '合同开始时间' AFTER `platform_name`, + ADD COLUMN `contact_end` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '合同结束时间' AFTER `contact_begin`, + ADD COLUMN `fax_ratio` VARCHAR(20) NOT NULL DEFAULT '0' COMMENT '开票税率' AFTER `contact_end`, + ADD COLUMN `company_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '公司性质:1-公司 2-个人' AFTER `fax_ratio`, + ADD COLUMN `is_sign_contact` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否签署合同:0-未签署 1-签署' AFTER `company_type`, + ADD COLUMN `company_belong` tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT '工会归属:0-内团;1-外团 2-分发联盟 3 无' AFTER `is_sign_contact`, + ADD COLUMN `resources` VARCHAR(2000) NULL DEFAULT '' COMMENT '文档' AFTER `company_belong`; \ No newline at end of file diff --git a/Public/static/czinputcheck.js b/Public/static/czinputcheck.js new file mode 100644 index 000000000..bc100c345 --- /dev/null +++ b/Public/static/czinputcheck.js @@ -0,0 +1,80 @@ +/** + * @info 前端input验证类 + * @version 20200213 + * @author chenzhi + * var obj = { + "type": ["required", "点击事件不能为空",'select'], + "sort":["number", "排序不能为空"], + "click_option": ["nocheck", "配置信息", "textarea"], + "remark": ["nocheck", "备注无需验证", "textarea"], + } + */ +(function(){ + function czinputcheck(){ + var cic = this; + cic.verify= { + required: [/[\S]+/, "必填项不能为空"], + phone: [/^1\d{10}$/, "请输入正确的手机号"], + email: [/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/, "邮箱格式不正确"], + url: [/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/, "链接格式不正确"], + intnumber: [/^\d+$/, "数字格式错误,数字不能含有小数"], + number:[/^\d+(\.{1}\d+)?$/,"数字格式错误"], + date: [/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/, "日期格式不正确"], + identity: [/(^\d{15}$)|(^\d{17}(x|X|\d)$)/, "请输入正确的身份证号"], + password:[/^[\S]{6,12}$/,"密码必须6到12位,且不能出现空格"], + isbn:[/^\d{13}$/, "isbn格式错误"], + price:[/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,"价格格式错误"], + bankid:[/^([1-9]{1})\d{9,19}$/,"银行卡格式错误"], + nocheck:[false,"无需验证,存在填,不存在舍弃"], + checkno:[false,"验证,存在填,不存在报错"], + }; + cic.checkAddInput=function(arr){ + var rearr = {}; + for(var i in arr) { + var reg = cic.verify[arr[i][0]][0]; + var name = "input"; + var selecttypename=''; + if(typeof arr[i][2] !== "undefined") name = arr[i][2]; + if(name == "radio") { + name="input"; + selecttypename=":checked"; + } + if(!reg){ + //nocheck时不验证 + var val = $(name+"[name='"+i+"']"+selecttypename).val(); + if(val != ''){ + rearr[i]=val; + } + }else{ + if(reg.test($(name+"[name='"+i+"']"+selecttypename).val())) { + rearr[i] = $(name+"[name='"+i+"']"+selecttypename).val(); + }else { + layer.alert(arr[i][1], { + icon: 2, + skin: 'layer-ext-moon' + }); + return false; + break; + } + } + } + return rearr; + }; + cic.setEditData=function(ydata,ndata){ + var data = {}; + for (var i in ndata) { + if(ndata[i] != ydata[i]){ + data[i] = ndata[i] + } + } + if($.isEmptyObject(data)) { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + return false; + }else{ + data.id = ydata.id; + return data; + } + }; + }; + window.CIC = new czinputcheck(); +})() \ No newline at end of file