添加推广员搜索功能添加组名/部门名

master
ELF 5 years ago
parent 843a429b43
commit 227c6e6ef9

@ -33,7 +33,7 @@ class QueryController extends BaseController
{
$page = intval(I('p', 1));
$row = intval(I('row', 10));
$ownId = intval(I('own_id'), 0);//本账号
$ownId = intval(I('own_id'), 0); //本账号
$relationGameId = intval(I('relation_game_id', 0));
$sdkVersion = intval(I('sdk_version', 0));
$serverId = trim(I('server_id', ''));
@ -1976,7 +1976,7 @@ class QueryController extends BaseController
public function getSubPromotes()
{
$promoteId = I('promote_id', 0) ?: -1;
$promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promoteId])->select();
$promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'group_remark'])->where(['parent_id' => $promoteId])->select();
$this->ajaxReturn([
'status' => 1,
'msg' => '成功',
@ -2063,7 +2063,7 @@ class QueryController extends BaseController
$games = get_promote_serach_game();
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $parent['id']])->select();
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'group_remark'])->where(['parent_id' => $parent['id']])->select();
$map = ['parent_id' => $parent['id']];
if ($promoteId > 0) {
@ -2072,6 +2072,7 @@ class QueryController extends BaseController
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level', 'chain'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');
$rows = [];

@ -56,10 +56,23 @@
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择{$searchLevelName}</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}({$promote.real_name})</option>
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>
{$promote.account}({$promote.real_name})
<?=$promote['group_remark'] ? ' - ' . $promote['group_remark'] : '' ?>
</option>
</volist>
</select>
</div>
<?php if($parent['level'] + 1 == 2):?>
<div class="form-group normal_space fr">
<input type="text" class="txt" name="group_remark" placeholder="部门名称" value="{:I('group_remark')}" >
</div>
<?php endif;?>
<?php if($parent['level'] + 1 == 3):?>
<div class="form-group normal_space fr">
<input type="text" class="txt" name="group_remark" placeholder="组长名称" value="{:I('group_remark')}" >
</div>
<?php endif;?>
<div class="form-group normal_space fr">
<input type="text" class="txt range-date" name="time" placeholder="起止时间" value="{$time}" >
</div>

@ -267,12 +267,13 @@ function getSubPromotes(url, parentId, level) {
success: function(response) {
var options = '<option value="0">请选择' + levelName + '</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
var selected = ''
if (defaultVal > 0 && promote.id == defaultVal) {
selected = 'selected'
}
options += '<option value="' + promote.id + '"' + selected + '>' + promote.account + '(' + promote.real_name + ')' + '</option>'
var promote = response.data.promotes[i]
var selected = ''
if (defaultVal > 0 && promote.id == defaultVal) {
selected = 'selected'
}
var groupRemark = (promote.group_remark == '' ? '' : ' - ' + promote.group_remark);
options += '<option value="' + promote.id + '"' + selected + '>' + promote.account + '(' + promote.real_name + ')' + groupRemark + '</option>'
}
selectTag.html(options)
selectTag.val(defaultVal).trigger("change")

Loading…
Cancel
Save