推广员后台->检索bug修复

master
chenxiaojun 5 years ago
parent c322f6ec7e
commit a5873caf8d

@ -457,6 +457,10 @@
$('#team_leader_id').change(function () { $('#team_leader_id').change(function () {
var promoteId = parseInt($(this).val()); var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text(); var promoteValue = $(this).find("option:selected").text();
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
$.ajax({ $.ajax({
url: "{:U('getChildPromoteList')}", url: "{:U('getChildPromoteList')}",
@ -464,13 +468,6 @@
data: {promote_id:promoteId}, data: {promote_id:promoteId},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteData = data.data; var promoteData = data.data;
if (promoteData.length > 0) { if (promoteData.length > 0) {
@ -478,14 +475,21 @@
html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>"; html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>";
} }
} }
showPromoteSelect(html);
}
});
} else {
showPromoteSelect(html);
} }
});
function showPromoteSelect(html)
{
$("#promote_id").empty(); $("#promote_id").empty();
$('#promote_id').html(html); $('#promote_id').html(html);
$("#promote_id").select2(); $("#promote_id").select2();
} }
});
});
$('#own').on('click', function () { $('#own').on('click', function () {
var ownId = $('#own_id').val(); var ownId = $('#own_id').val();

@ -279,6 +279,10 @@
$('#team_leader_id').change(function () { $('#team_leader_id').change(function () {
var promoteId = parseInt($(this).val()); var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text(); var promoteValue = $(this).find("option:selected").text();
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
$.ajax({ $.ajax({
url: "{:U('getChildPromoteList')}", url: "{:U('getChildPromoteList')}",
@ -286,13 +290,6 @@
data: {promote_id:promoteId}, data: {promote_id:promoteId},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteData = data.data; var promoteData = data.data;
if (promoteData.length > 0) { if (promoteData.length > 0) {
@ -300,14 +297,21 @@
html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>"; html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>";
} }
} }
showPromoteSelect(html);
}
});
} else {
showPromoteSelect(html);
} }
});
function showPromoteSelect(html)
{
$("#promote_id").empty(); $("#promote_id").empty();
$('#promote_id').html(html); $('#promote_id').html(html);
$("#promote_id").select2(); $("#promote_id").select2();
} }
});
});
$('#own').on('click',function () { $('#own').on('click',function () {
var ownId = $('#own_id').val(); var ownId = $('#own_id').val();

@ -188,6 +188,10 @@
$('#team_leader_id').change(function () { $('#team_leader_id').change(function () {
var promoteId = parseInt($(this).val()); var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text(); var promoteValue = $(this).find("option:selected").text();
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
$.ajax({ $.ajax({
url: "{:U('getChildPromoteList')}", url: "{:U('getChildPromoteList')}",
@ -195,13 +199,6 @@
data: {promote_id:promoteId}, data: {promote_id:promoteId},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteData = data.data; var promoteData = data.data;
if (promoteData.length > 0) { if (promoteData.length > 0) {
@ -209,14 +206,21 @@
html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>"; html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>";
} }
} }
showPromoteSelect(html);
}
});
} else {
showPromoteSelect(html);
} }
});
function showPromoteSelect(html)
{
$("#promote_id").empty(); $("#promote_id").empty();
$('#promote_id').html(html); $('#promote_id').html(html);
$("#promote_id").select2(); $("#promote_id").select2();
} }
});
});
$('#own').on('click',function () { $('#own').on('click',function () {
var ownId = $('#own_id').val(); var ownId = $('#own_id').val();

@ -244,6 +244,10 @@
$('#team_leader_id').change(function () { $('#team_leader_id').change(function () {
var promoteId = parseInt($(this).val()); var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text(); var promoteValue = $(this).find("option:selected").text();
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
$.ajax({ $.ajax({
url: "{:U('getChildPromoteList')}", url: "{:U('getChildPromoteList')}",
@ -251,13 +255,6 @@
data: {promote_id:promoteId}, data: {promote_id:promoteId},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteData = data.data; var promoteData = data.data;
if (promoteData.length > 0) { if (promoteData.length > 0) {
@ -265,14 +262,21 @@
html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>"; html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>";
} }
} }
showPromoteSelect(html);
}
});
} else {
showPromoteSelect(html);
} }
});
function showPromoteSelect(html)
{
$("#promote_id").empty(); $("#promote_id").empty();
$('#promote_id').html(html); $('#promote_id').html(html);
$("#promote_id").select2(); $("#promote_id").select2();
} }
});
});
$('#own').on('click',function () { $('#own').on('click',function () {
var ownId = $('#own_id').val(); var ownId = $('#own_id').val();

Loading…
Cancel
Save