diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php
index 012a7a5ff..f63370a9f 100644
--- a/Application/Admin/Controller/AjaxController.class.php
+++ b/Application/Admin/Controller/AjaxController.class.php
@@ -522,4 +522,22 @@ class AjaxController extends ThinkController{
# code...
}
+ /**
+ *获取上下游公司
+ */
+ public function getCompanyList()
+ {
+ $company_type = I('company_type');//公司类型
+ if ($company_type ==1) {//上游公司
+ $data = M('partner','tab_')->field('id, partner as name,1 as type')->where(['status' => 1])->select();
+ } elseif ($company_type ==2) {//下游公司
+ $data = M('promote_company','tab_')->field('id, company_name as name,2 as type')->where(['status' => 1])->select();
+ } else {
+ $partner = M('partner','tab_')->field('id, partner as name,1 as type')->where(['status' => 1])->select();
+ $promote_company = M('promote_company','tab_')->field('id, company_name as name, 2 as type')->where(['status' => 1])->select();
+ $data = array_merge($partner, $promote_company);
+ }
+ $this->ajaxReturn($data);
+ }
+
}
\ No newline at end of file
diff --git a/Application/Admin/View/StatementMangement/rewardManageList.html b/Application/Admin/View/StatementMangement/rewardManageList.html
index 064f94ca5..8ac38dd30 100644
--- a/Application/Admin/View/StatementMangement/rewardManageList.html
+++ b/Application/Admin/View/StatementMangement/rewardManageList.html
@@ -77,7 +77,7 @@
@@ -201,6 +201,31 @@
$(".select_gallery").select2();
highlight_subnav("{:U('StatementMangement/rewardManageList')}");
+ function get_company_list()
+ {
+ var id = $('#partner_id').val();
+ var company_type = $("#company_type option:selected").val();
+ $.ajax({
+ url:"{:U('Ajax/getCompanyList')}",
+ type:"post",
+ data:{
+ company_type:company_type,
+ },
+ dataType:'json',
+ success:function(data){
+ var str = "";
+ for (var i in data){
+ str += ""
+ }
+ // console.log(str);
+ $("#partner_id").empty();
+ $("#partner_id").append(str);
+ $("#partner_id").select2();
+
+ }
+ })
+ }
+
function get_game_list()
{
var game_name = $('#game_name').val();
@@ -228,9 +253,13 @@
})
}
$(function(){
+ get_company_list();
$("#partner_id").change(function(){
get_game_list();
});
+ $("#company_type").change(function(){
+ get_company_list();
+ });
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');