diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 82eb0728a..9a31bf19a 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 = []; diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 779518460..d4825c0dd 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,80 @@ 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'] == 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`='无' 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 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 { + + $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 new file mode 100644 index 000000000..98ac23e40 --- /dev/null +++ b/Application/Admin/View/PromoteCompany/promotedataconfigindex.html @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +
+ + + + + + + + + + + +
联盟分发订单归属: +
+ +
+
聚合平台订单归属: +
+ +
+
+ + +
+
+
+ + + 返回 + +
+ +
+
+ +
+ + + + + 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 5a36ceed2..de8bba35d 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1605,6 +1605,10 @@ 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`; --新增参数kv表 chenzhi 20200422 CREATE TABLE `sys_kv` ( @@ -1644,4 +1648,7 @@ CREATE TABLE `tab_aggregate_statement` ( KEY `withdraw_type` (`withdraw_type`) USING BTREE, KEY `channel_id` (`channel_id`) USING BTREE, KEY `link_phone` (`link_phone`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='聚合渠道结算单'; \ No newline at end of file +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='聚合渠道结算单'; +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