From a5554f7fa34e0c43cf3ca866c65337ef7441067b Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 17 Apr 2020 18:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=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 @@
- + 聚合平台订单归属: