Commit 428b6b38 by 冷斌

update

parent cd5c97fe
...@@ -69,6 +69,21 @@ ...@@ -69,6 +69,21 @@
} }
},'json'); },'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(){ $("#belong").on('click',function(){
var uid = $("[name='uid']").val(); var uid = $("[name='uid']").val();
var one_id = $("#one").val(); var one_id = $("#one").val();
......
...@@ -899,5 +899,36 @@ class IndexadminController extends AdminbaseController { ...@@ -899,5 +899,36 @@ class IndexadminController extends AdminbaseController {
} }
echo json_encode($data); 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