|
|
@ -1995,18 +1995,34 @@ function get_parent_promote_($prmote_id=0,$isShwo=true)
|
|
|
|
|
|
|
|
|
|
|
|
//获取当前子渠道
|
|
|
|
//获取当前子渠道
|
|
|
|
function get_zi_promote_id($id){
|
|
|
|
function get_zi_promote_id($id){
|
|
|
|
$map['parent_id']=$id;
|
|
|
|
// $map['parent_id']=$id;
|
|
|
|
$map['grand_id'] = $id;
|
|
|
|
// $map['grand_id'] = $id;
|
|
|
|
$map['_logic'] = 'or';
|
|
|
|
// $map['_logic'] = 'or';
|
|
|
|
$pro=M("promote","tab_")->field('id')->where($map)->select();
|
|
|
|
// $pro=M("promote","tab_")->field('id')->where($map)->select();
|
|
|
|
if(null==$pro){
|
|
|
|
// if(null==$pro){
|
|
|
|
return 0;
|
|
|
|
// return 0;
|
|
|
|
}else{
|
|
|
|
// }else{
|
|
|
|
for ($i=0; $i <count($pro); $i++) {
|
|
|
|
// for ($i=0; $i <count($pro); $i++) {
|
|
|
|
$sd[]=implode(",", $pro[$i]);
|
|
|
|
// $sd[]=implode(",", $pro[$i]);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
return implode(",", $sd);
|
|
|
|
// return implode(",", $sd);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
$promote = M("promote","tab_");
|
|
|
|
|
|
|
|
//获取自己的等级
|
|
|
|
|
|
|
|
$self = $promote->field("chain,level")->where("id = '{$id}'")->find();
|
|
|
|
|
|
|
|
if ($self['level'] == 1) {
|
|
|
|
|
|
|
|
$self['chain'] = "/{$id}/";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$map['status'] = 1;
|
|
|
|
|
|
|
|
$map["chain"] = array("LIKE","%{$self['chain']}%");
|
|
|
|
|
|
|
|
$map["level"] = array("GT",$self['level']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data = $promote->field("id")->where($map)->select();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(empty($data)){return array();}
|
|
|
|
|
|
|
|
$data = implode(",",array_column($data,"id"));
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|