From 295ca2d8039505539788d7542e6c38090abd2170 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 17 Apr 2020 17:31:57 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 61 +++++++ .../promotedataconfigindex.html | 162 ++++++++++++++++++ Application/Admin/View/Spend/lists.html | 3 +- Data/update.sql | 8 + 4 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 Application/Admin/View/PromoteCompany/promotedataconfigindex.html diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 779518460..5e6dc0a92 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -2,6 +2,7 @@ namespace Admin\Controller; +use mysql_xdevapi\Exception; use User\Api\UserApi as UserApi; use OSS\OssClient; use OSS\Core\OSsException; @@ -472,4 +473,64 @@ class PromoteCompanyController extends ThinkController } # code... } + + public function promoteDataConfigIndex() { + + if (IS_POST) { + + $changeData = I('post.',''); + + $promoteData = M("promote","tab_") + ->field("id") + ->where(['company_belong'=>2]) + ->select(); + + $promoteData = implode(',',array_column($promoteData,'id')); + + if ($changeData['admin_type']) { + + + $num_pend = 0; + $num_deposit = 0; + if ($promoteData) { + + $sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in ({$promoteData})"; + $sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in ({$promoteData})"; + + $model = new \Think\Model(); + $num_pend = $model->execute($sql_spend,true); +// $num_deposit = $model->execute($sql_deposit,true); + + $this->ajaxReturn(['info'=>"将数据设为'{$changeData['admin_type']}',处理订单数据".($num_pend+$num_deposit).'条']); + + } + + } +// else { +// $num_pend = 0; +// $num_deposit = 0; +// +// if ($promoteData) { +// +// $sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in ({$promoteData})"; +// $sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in ({$promoteData})"; +// +// $model = new \Think\Model(); +// $num_pend = $model->execute($sql_spend,true); +// $num_deposit = $model->execute($sql_deposit,true); +// +// $this->ajaxReturn(['info'=>"将数据还原,处理数据".($num_pend+$num_deposit).'条']); +// +// } +// +// } + + } else { + + $this->display(); + + } + + } + } diff --git a/Application/Admin/View/PromoteCompany/promotedataconfigindex.html b/Application/Admin/View/PromoteCompany/promotedataconfigindex.html new file mode 100644 index 000000000..51e44c5c0 --- /dev/null +++ b/Application/Admin/View/PromoteCompany/promotedataconfigindex.html @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +
+ + + + + + + + + + + +
联盟分发订单归属: +
+ +
+
聚合平台订单归属: +
+ +
+
+ + +
+
+
+ + + 返回 + +
+ +
+
+ +
+ + + + + diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index 438a93554..ee14ed000 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -211,7 +211,8 @@ {:encryptStr(get_promote_account($data['promote_id']))} --> - {:get_promote_account($data['promote_id'])} + {$data['promote_account']} + {$data.spend_ip} diff --git a/Data/update.sql b/Data/update.sql index d0563deee..44157231e 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1567,3 +1567,11 @@ CREATE TABLE `tab_finance_compare_info` ( KEY `pay_way` (`pay_way`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='财务导入对账详情表'; +--新增财务导入对账详情表 zyx 20200417 +ALTER TABLE `tab_spend` +ADD COLUMN `old_change_promote_id` int(11) NULL DEFAULT 0 COMMENT '修改配置前渠道' AFTER `old_promote_account`, +ADD COLUMN `old_change_promote_account` varchar(30) NULL COMMENT '修改配置前渠道账号' AFTER `old_change_promote_id`; + +ALTER TABLE `tab_deposit` +ADD COLUMN `old_change_promote_id` int(11) NULL DEFAULT 0 COMMENT '修改配置前渠道' , +ADD COLUMN `old_change_promote_account` varchar(30) NULL COMMENT '修改配置前渠道账号' ; \ No newline at end of file From a5554f7fa34e0c43cf3ca866c65337ef7441067b Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 17 Apr 2020 18:14:36 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 47 ++++++++++--------- .../promotedataconfigindex.html | 10 ++-- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 5e6dc0a92..0c4fc4767 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -487,43 +487,44 @@ class PromoteCompanyController extends ThinkController $promoteData = implode(',',array_column($promoteData,'id')); - if ($changeData['admin_type']) { + if ($changeData['admin_type'] == 1) { $num_pend = 0; $num_deposit = 0; if ($promoteData) { - $sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in ({$promoteData})"; - $sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in ({$promoteData})"; + $sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in({$promoteData})"; + $sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in({$promoteData})"; $model = new \Think\Model(); $num_pend = $model->execute($sql_spend,true); -// $num_deposit = $model->execute($sql_deposit,true); + $num_deposit = $model->execute($sql_deposit,true); - $this->ajaxReturn(['info'=>"将数据设为'{$changeData['admin_type']}',处理订单数据".($num_pend+$num_deposit).'条']); + $this->ajaxReturn(['info'=>"处理订单数据".($num_pend+$num_deposit).'条']); + + } + + } else if ($changeData['admin_type'] == 2){ + $num_pend = 0; + $num_deposit = 0; + + if ($promoteData) { + + $sql_spend = "UPDATE `tab_spend` SET `promote_id`=`old_change_promote_id`,`promote_account`=`old_change_promote_account`,`old_change_promote_id`=0,`old_change_promote_account`='' +WHERE old_change_promote_id in ({$promoteData})"; + $sql_deposit = "UPDATE `tab_deposit` SET `promote_id`=`old_change_promote_id`,`promote_account`=`old_change_promote_account`,`old_change_promote_id`=0,`old_change_promote_account`='' +WHERE old_change_promote_id in ({$promoteData})"; + + $model = new \Think\Model(); + $num_pend = $model->execute($sql_spend,true); + $num_deposit = $model->execute($sql_deposit,true); + + $this->ajaxReturn(['info'=>"将数据还原,处理订单数据".($num_pend+$num_deposit).'条']); } } -// else { -// $num_pend = 0; -// $num_deposit = 0; -// -// if ($promoteData) { -// -// $sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in ({$promoteData})"; -// $sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in ({$promoteData})"; -// -// $model = new \Think\Model(); -// $num_pend = $model->execute($sql_spend,true); -// $num_deposit = $model->execute($sql_deposit,true); -// -// $this->ajaxReturn(['info'=>"将数据还原,处理数据".($num_pend+$num_deposit).'条']); -// -// } -// -// } } else { diff --git a/Application/Admin/View/PromoteCompany/promotedataconfigindex.html b/Application/Admin/View/PromoteCompany/promotedataconfigindex.html index 51e44c5c0..34cf638d0 100644 --- a/Application/Admin/View/PromoteCompany/promotedataconfigindex.html +++ b/Application/Admin/View/PromoteCompany/promotedataconfigindex.html @@ -52,19 +52,19 @@
- + 聚合平台订单归属:
From 5dbd0eb8fa58e811108e89434238adf2aac6e38f Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Sun, 26 Apr 2020 16:09:20 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=B8=9A=E7=BB=A9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/PromoteCompanyController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 0c4fc4767..f2d3ee7e8 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -528,7 +528,7 @@ WHERE old_change_promote_id in ({$promoteData})"; } else { - $this->display(); + $this->display('promotedataconfigindex'); } From 38f478d63d046397d2984dcc84b74fb1a4f803fe Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Sun, 26 Apr 2020 17:02:37 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PromoteCompanyController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index f2d3ee7e8..a2e52ec76 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -494,8 +494,8 @@ class PromoteCompanyController extends ThinkController $num_deposit = 0; if ($promoteData) { - $sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in({$promoteData})"; - $sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in({$promoteData})"; + $sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in({$promoteData})"; + $sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in({$promoteData})"; $model = new \Think\Model(); $num_pend = $model->execute($sql_spend,true); From 4f88cd025ea38b5fa5ce6ea0c1e6274616bb8672 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Sun, 26 Apr 2020 17:11:29 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=BB=91=E5=B8=81=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/ExportController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 48f9e40a7..f742f1192 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2253,9 +2253,9 @@ class ExportController extends Controller if(!empty(I('get.extend'))) { $map['tab_spend.extend'] = I('get.extend'); - $data = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->page($p, $row)->order('tab_repair_pay.id DESC')->select(); + $data = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->order('tab_repair_pay.id DESC')->select(); } else { - $data = M('repair_pay', 'tab_')->where($map)->page($p, $row)->order('id DESC')->select(); + $data = M('repair_pay', 'tab_')->where($map)->order('id DESC')->select(); } $xlsData = []; From 613d60e4a7416fda803fb25e5a8845b5db71df11 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 27 Apr 2020 09:47:49 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteCompanyController.class.php | 15 +++++++++++++++ .../PromoteCompany/promotedataconfigindex.html | 13 ++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index a2e52ec76..d4825c0dd 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -528,6 +528,21 @@ WHERE old_change_promote_id in ({$promoteData})"; } else { + $promoteData = M("promote","tab_") + ->field("id") + ->where(['company_belong'=>2]) + ->select(); + + $promoteData = implode(',',array_column($promoteData,'id')); + + $spendData = M('spend','tab_')->field("old_change_promote_account")->where(['old_change_promote_id'=>['in',$promoteData]])->find(); + +// var_dump($spendData);die(); + + if ($spendData['old_change_promote_account']) { + $this->assign('old_change_promote_account',1); + } + $this->display('promotedataconfigindex'); } diff --git a/Application/Admin/View/PromoteCompany/promotedataconfigindex.html b/Application/Admin/View/PromoteCompany/promotedataconfigindex.html index 34cf638d0..98ac23e40 100644 --- a/Application/Admin/View/PromoteCompany/promotedataconfigindex.html +++ b/Application/Admin/View/PromoteCompany/promotedataconfigindex.html @@ -52,8 +52,8 @@
@@ -142,13 +142,8 @@ data: cres, dataType: "json", success: function (data) { - if (data.status == 1) { - layer.msg(data.info, function () { - window.location.href = "{:U('PromoteCompany/promoteDataConfigIndex')}"; - }); - } else { - layer.msg(data.info); - } + layer.msg(data.info); + window.location.reload(); }, error: function (e) {