From 6d91ec7c60ca526cb62bfe21a4db4ed7f6fb930d Mon Sep 17 00:00:00 2001
From: liuweiwen <“529520975@qq.com>
Date: Tue, 18 Feb 2020 16:37:19 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98-=E3=80=8B=E5=A5=96?=
=?UTF-8?q?=E7=BD=9A=E8=AE=B0=E5=BD=95=E7=AE=A1=E7=90=86-=E3=80=8B?=
=?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=B8=B8=E5=85=AC=E5=8F=B8=E4=B8=8E=E5=85=AC?=
=?UTF-8?q?=E5=8F=B8=E7=B1=BB=E5=9E=8B=E8=81=94=E5=8A=A8=EF=BC=8C=E8=A7=A3?=
=?UTF-8?q?=E5=86=B3=E6=9C=AA=E6=98=BE=E7=A4=BA=E4=B8=8B=E6=B8=B8=E5=85=AC?=
=?UTF-8?q?=E5=8F=B8=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/AjaxController.class.php | 18 +++++++++++
.../StatementMangement/rewardManageList.html | 31 ++++++++++++++++++-
2 files changed, 48 insertions(+), 1 deletion(-)
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');