Commit 428b6b38 by 冷斌

update

parent cd5c97fe
......@@ -12,12 +12,12 @@
<div class="controls" style="margin-top: 15px;">
当前归属:{$proxy_str}
</div>
<div class="controls" style="margin-top: 15px;">
<div class="controls" style="margin-top: 15px;">
修改归属:
<select id="one" name="one_id"><option value="0">请选择一级代理</option><volist name="ones" id="one"><option value="{$one.id}">{$one.user_nicename}({$one.id})</option></volist></select>
<select id="two" name="two_id" disabled="true"><option value="0">请选择二级代理</option></select>
<if condition="$ispu">
<br/>
修改归属:
......@@ -45,7 +45,7 @@
if(data.html.anchor != ''){
$("#three").prop('disabled',false);
$("#three").html(data.html.anchor);
}
}
}else{
$("#two").html('<option value="0">请选择二级代理</option>');
$("#two").prop('disabled',true);
......@@ -62,13 +62,28 @@
//console.log(data);
if(data.state == 'success' && data.status == 1){
$("#three").prop('disabled',false);
$("#three").html(data.html);
$("#three").html(data.html);
}else{
$("#three").html('<option value="0">请选择主播</option>');
$("#three").prop('disabled',true);
}
},'json');
});
//查找主播下的推广员
$("#three").on('change',function(e){
var three_id = $(this).val();
//查找二级代理
$.post("{:U('indexadmin/get_tuiguang')}",{three_id:three_id},function(data){
//console.log(data);
if(data.state == 'success' && data.status == 1){
$("#four").prop('disabled',false);
$("#four").html(data.html);
}else{
$("#four").html('<option value="0">请选择推广员</option>');
$("#four").prop('disabled',true);
}
},'json');
});
$("#belong").on('click',function(){
var uid = $("[name='uid']").val();
var one_id = $("#one").val();
......@@ -79,8 +94,8 @@
$.post("{:U('indexadmin/belong_post')}",{uid:uid,one_id:one_id,two_id:two_id,three_id:three_id,four_id:four_id},function(data){
console.log(data);
if(data.state == 'success' && data.status == 1){
//alert("设置成功!");
$("#result").html(data.info);
setTimeout(function(){
......
......@@ -899,5 +899,36 @@ class IndexadminController extends AdminbaseController {
}
echo json_encode($data);
}
//获取推广员
public function get_tuiguang()
{
$data['html'] = '<option value="0">请选择推广员</option>';
$data['state'] = 'error';
$data['status'] = 0;
$three_id = intval($_POST['three_id']);
$Proxy = M('users_proxy');
$Users = M('users');
$path = setpath($three_id);
//所有的推广员
$proxys = $Proxy->field('uid')->where("type=-1 and path like '%{$path}%'")->select();
$html = '';
if ($proxys) {
$data['state'] = 'success';
$data['status'] = 1;
foreach ($proxys as $k => $v) {
$user = $Users->where("id={$v['uid']} and tg_type=5")->find();
if ($user) {
$data['html'] .= '<option value="' . $user['id'] . '">' . $user['user_nicename'] . '(' . $user['id'] . ')</option>';
// $data['proxys'][$k]['uid'] = $user['id'];
// $data['proxys'][$k]['name'] = $user['user_nicename'];
}
}
//$data['html'] .= $html;
}
echo json_encode($data);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment