diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index c438a2f3f..f579f16c6 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -587,4 +587,15 @@ class AjaxController extends ThinkController{ $result = M('promote', 'tab_')->field("id,account,nickname")->where(['parent_id'=>$pid])->select(); $this->ajaxReturn(['code'=>1, 'data'=>$result]); } + + public function getPromotersByLevelResource() + { + $level = I('level'); + if (!$level) { +// return $this->ajaxReturn(['code'=>1, 'msg'=>'获取成功', 'data'=>[]]); + $level = ''; + } + $this->ajaxReturn(['code'=>1, 'msg'=>'获取成功', 'data'=>(new PromoteModel)->getPromotersByLevelResource($level)]); + } + } \ No newline at end of file diff --git a/Application/Admin/Controller/TestResourceController.class.php b/Application/Admin/Controller/TestResourceController.class.php index f9d1fde7a..b2ee6593b 100644 --- a/Application/Admin/Controller/TestResourceController.class.php +++ b/Application/Admin/Controller/TestResourceController.class.php @@ -78,8 +78,23 @@ class TestResourceController extends ThinkController if(!empty(I('user_account'))){ $map['tab_test_resource.user_account']=['like','%'.I('user_account').'%']; } - if(!empty(I('promote_name'))){ - $map['tab_test_resource.promote_account']=['like','%'.I('promote_name').'%']; + if(!empty(I('promote_id')) || I('promote_id')=="0"){ + + $promote_id = I('promote_id'); + + $promnote_arr = M("promote","tab_")->field("id")->where("chain like '%/{$promote_id}/%'")->select(); + + $promnote_arr = array_column($promnote_arr,"id"); + array_push($promnote_arr,$promote_id); + + $promnote_arr = implode(",",$promnote_arr); + + $map['tab_test_resource.promote_id']=['in',$promnote_arr]; + + if (!I("promote_level")) { + $map['tab_test_resource.promote_id']=I('promote_id'); + } + } //为数据权限添加 setPowerPromoteIds($map, 'tab_test_resource.promote_id'); @@ -91,6 +106,8 @@ class TestResourceController extends ThinkController ->order('tab_test_resource.create_time DESC') ->select(); +// var_dump($data);die(); + foreach ($data as $key => $value) { $data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); } diff --git a/Application/Admin/Model/PromoteModel.class.php b/Application/Admin/Model/PromoteModel.class.php index 6b80b7179..b5d1d781f 100644 --- a/Application/Admin/Model/PromoteModel.class.php +++ b/Application/Admin/Model/PromoteModel.class.php @@ -450,5 +450,30 @@ class PromoteModel extends Model{ } + public function getPromotersByLevelResource($level) + { + + if ($level) { + $where['level'] = $level; + } + + $userAuth = session('user_auth'); + setPowerPromoteIds($where,'id'); + + $offcialData = [0=>['id'=>0,'nickname'=>'官方渠道']]; + + $result = $this->field("*")->where($where)->select(); + foreach ($result as &$item) { + $item['nickname'] = $item['account'] . ($item['nickname'] ? "({$item['nickname']})" : ""); + } + + if ((in_array('0',explode(',',$where['id'][1]))||$userAuth['data_empower_type']==1)) { + $result = array_merge($offcialData,$result); +// dump($result);die(); + } + + return $result; + } + } \ No newline at end of file diff --git a/Application/Admin/View/TestResource/supportNumberList.html b/Application/Admin/View/TestResource/supportNumberList.html index 341c8abf6..41934642b 100644 --- a/Application/Admin/View/TestResource/supportNumberList.html +++ b/Application/Admin/View/TestResource/supportNumberList.html @@ -74,10 +74,27 @@ -