|
|
@ -50,7 +50,7 @@ class PromoteController extends ThinkController
|
|
|
|
if (isset($_REQUEST['promote_id'])) {
|
|
|
|
if (isset($_REQUEST['promote_id'])) {
|
|
|
|
$promoteid = $_REQUEST['promote_id'];
|
|
|
|
$promoteid = $_REQUEST['promote_id'];
|
|
|
|
|
|
|
|
|
|
|
|
$map['id'] = $_REQUEST['promote_id'];
|
|
|
|
$map['p.id'] = $_REQUEST['promote_id'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isset($_REQUEST['parent_id'])) {
|
|
|
|
if (isset($_REQUEST['parent_id'])) {
|
|
|
|
if ($_REQUEST['parent_id']=='全部') {
|
|
|
|
if ($_REQUEST['parent_id']=='全部') {
|
|
|
@ -68,12 +68,12 @@ class PromoteController extends ThinkController
|
|
|
|
if ($promoteid > 0 ) {
|
|
|
|
if ($promoteid > 0 ) {
|
|
|
|
if (in_array($promoteid,$zidarr)) {
|
|
|
|
if (in_array($promoteid,$zidarr)) {
|
|
|
|
# code...
|
|
|
|
# code...
|
|
|
|
$map['id'] = $promoteid;
|
|
|
|
$map['p.id'] = $promoteid;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$map['id'] = 0;
|
|
|
|
$map['p.id'] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$map['id']=array('in',$zid);
|
|
|
|
$map['p.id']=array('in',$zid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//
|
|
|
|
//
|
|
|
|
unset($_REQUEST['parent_id']);
|
|
|
|
unset($_REQUEST['parent_id']);
|
|
|
@ -87,7 +87,7 @@ class PromoteController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (I('status') || I('status', -1) == 0) {
|
|
|
|
if (I('status') || I('status', -1) == 0) {
|
|
|
|
$map['status'] = I('status');
|
|
|
|
$map['p.status'] = I('status');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (I('ver_status') || I('ver_status', -1) == 0) {
|
|
|
|
if (I('ver_status') || I('ver_status', -1) == 0) {
|
|
|
@ -95,14 +95,14 @@ class PromoteController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (I("promote_level")) {
|
|
|
|
if (I("promote_level")) {
|
|
|
|
$map['level'] = I("promote_level");
|
|
|
|
$map['p.level'] = I("promote_level");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (strlen(I('company_belong'))) {
|
|
|
|
if (strlen(I('company_belong'))) {
|
|
|
|
$map['company_belong'] = I("company_belong");
|
|
|
|
$map['p.company_belong'] = I("company_belong");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_null(I('admin_uid', null))) {
|
|
|
|
if (!is_null(I('admin_uid', null))) {
|
|
|
|
$map['admin_id'] = I('admin_uid');
|
|
|
|
$map['p.admin_id'] = I('admin_uid');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->m_title = '推广员列表';
|
|
|
|
$this->m_title = '推广员列表';
|
|
|
@ -149,8 +149,21 @@ class PromoteController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//为数据权限添加
|
|
|
|
//为数据权限添加
|
|
|
|
setPowerPromoteIds($map, 'id');
|
|
|
|
setPowerPromoteIds($map, 'p.id');
|
|
|
|
$list_data = D(self::model_name)->where($map)->order('id DESC')->page($p, $row)->select();
|
|
|
|
$list_data = D(self::model_name)
|
|
|
|
|
|
|
|
->alias("p")
|
|
|
|
|
|
|
|
->field("p.*,IFNULL(m.nickname,'无') admin_nickname,IFNULL(b.account,'暂无') b_account,IFNULL(if(substring_index(substring_index(p.`chain`,'/',2),'/',-1)='',p.id,substring_index(substring_index(p.`chain`,'/',2),'/',-1)),0) top_id")
|
|
|
|
|
|
|
|
->join("sys_member m on p.admin_id = m.uid","left")
|
|
|
|
|
|
|
|
->join("tab_business_affairs b on p.ba_id = b.id","left")
|
|
|
|
|
|
|
|
->where($map)->order('id DESC');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(isset($_REQUEST['export'])){
|
|
|
|
|
|
|
|
$list_data = $list_data->select(false);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$list_data = $list_data->page($p, $row)->select(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$list_data = M()->table("(".$list_data.") a")->field("a.*,pr.account top_account")->join("tab_promote pr on a.top_id = pr.id")->select();
|
|
|
|
$list_data = D(self::model_name)->parseListData($list_data);
|
|
|
|
$list_data = D(self::model_name)->parseListData($list_data);
|
|
|
|
$oa_data = [];
|
|
|
|
$oa_data = [];
|
|
|
|
if (I('oa_associated', -1) == -1) {
|
|
|
|
if (I('oa_associated', -1) == -1) {
|
|
|
@ -178,7 +191,33 @@ class PromoteController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$count = D(self::model_name)->where($map)->count();
|
|
|
|
//导出
|
|
|
|
|
|
|
|
if(isset($_REQUEST['export'])){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$GetData = $_GET;
|
|
|
|
|
|
|
|
unset($GetData['export']);
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"推广员-推广员管理-推广员列表-导出"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data2csv($list_data,'推广员列表',array(
|
|
|
|
|
|
|
|
"id"=>"推广员ID",
|
|
|
|
|
|
|
|
"account"=>"推广员账号",
|
|
|
|
|
|
|
|
"mobile_phone"=>"手机号码",
|
|
|
|
|
|
|
|
"balance_coin"=>"平台币余额",
|
|
|
|
|
|
|
|
"pay_amount"=>"总流水",
|
|
|
|
|
|
|
|
"create_time"=>"注册时间",
|
|
|
|
|
|
|
|
"last_login_time"=>"最后登录时间",
|
|
|
|
|
|
|
|
"level_name"=>"渠道类型",
|
|
|
|
|
|
|
|
"top_account"=>"所属会长",
|
|
|
|
|
|
|
|
"company_belong_str"=>"公会归属",
|
|
|
|
|
|
|
|
"company_relation_str"=>"公会关系",
|
|
|
|
|
|
|
|
"admin_nickname"=>"归属管理员",
|
|
|
|
|
|
|
|
"b_account"=>"商务专员",
|
|
|
|
|
|
|
|
"status_str"=>"状态",
|
|
|
|
|
|
|
|
"ver_status"=>"身份状态",
|
|
|
|
|
|
|
|
"oa_associated_str"=>"oa关联"
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$count = D(self::model_name)->alias("p")->where($map)->count();
|
|
|
|
$page = set_pagination($count, $row);
|
|
|
|
$page = set_pagination($count, $row);
|
|
|
|
if ($page) {
|
|
|
|
if ($page) {
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
$this->assign('_page', $page);
|
|
|
|