优化推广公司添加

master
chenzhi 5 years ago
parent da2e3a769c
commit f218544e7f

@ -20,15 +20,22 @@ class PromoteCompanyController extends ThinkController
{
$model = M($this->modelName, 'tab_');
$map = [];
$promotemap=[];
$company_name = trim(I('company_name'));
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; //默认显示第一页数据
@ -43,17 +50,11 @@ class PromoteCompanyController extends ThinkController
->select();
//获取公司id
$companyids = implode(',', array_column($companyres, 'id'));
// //处理公司数据
// $company = array();
// foreach($companyres as $k=>$v){
// $company[]
// }
//获取所属会长及其游戏分成
$promotemap['company_id']=["in",$companyids];
$promoteres = M("Promote","tab_")
->field("id,company_id,account,settlement_type")
->where(array(
"company_id"=>["in",$companyids]
))
->where($promotemap)
->select();
//获取会长id
$promoteids = implode(',', array_column($promoteres, 'id'));
@ -188,6 +189,7 @@ class PromoteCompanyController extends ThinkController
$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();
@ -211,6 +213,9 @@ class PromoteCompanyController extends ThinkController
$save = I('post.');//前端已经验证
$save['create_time'] = $time;
$save['last_up_time'] = $time;
$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);
}

@ -29,28 +29,53 @@
.data_list table td{
text-indent:0;
}
.data_game_list table td{
line-height:1;
padding: 3px;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">说明:该功能是用于录入工会所属的推广公司名称</p>
</div>
<div class="jssearch search_list fl cf">
<div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<a class="" href="{:U('add')}"><span class="button_icon button_icon1"></span>新增</a>
<a class="ajax-post confirm " target-form="ids" url="{:U('del')}"><span class="button_icon button_icon2"></span>删除</a>
<!-- <a class="ajax-post confirm " target-form="ids" url="{:U('del')}"><span class="button_icon button_icon2"></span>删除</a> -->
</div>
</div>
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="sleft">
<input type="text" name="company_name" class="search-input" value="{:I('company_name')}" placeholder="请输入公司名称搜索">
<a class="sch-btn" href="javascript:;" id="search" url="__SELF__">搜索</a>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list">
<input style="width: 200px;" type="text" name="company_name" class="search-input" value="{:I('company_name')}" placeholder="请输入公司名称搜索">&nbsp;
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" style="width: 200px;">
<option value="">推广员账号</option>
<volist name="promoteList" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}({$vo.real_name})</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="company_type" name="company_type" class="select_gallery">
<option value="">请选择公司性质</option>
<option value="1" <?php echo I('company_type') === 1 ? "selected" : ''?>>公司</option>
<option value="2" <?php echo I('company_type') == 2 ? "selected" : ''?>>个人</option>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PromoteCompany/lists','model='.$model['name'].'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
</div>
@ -77,19 +102,18 @@
<th>产品类型</th>
<th>游戏名称</th>
<th colspan="2">合作方分成比例</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="6" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="99" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="listData" id="data" key="companykey">
<tr>
<td rowspan="{$data.row}">
<a href="{:U('view',array('id'=>$data['id']))}">查看</a>
<a href="{:U('edit',array('id'=>$data['id']))}">编辑</a>
<a href="{:U('del',array('id'=>$data['id']))}" class="confirm ajax-get">删除</a>
</td>
@ -191,14 +215,14 @@
{$_page|default=''}
</div>
<div class="common_settings">
<!-- <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="Partner/lists">
</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>
</div> -->
</block>

Loading…
Cancel
Save