diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index ff30dda40..e4ff6b0fd 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -1035,11 +1035,24 @@ public function auto_rrdae(){ return $ret; } - //会长提现 - public function promoteWithdraw() + //会长周结 + public function promoteWithdrawWeekly() + { + $this->promoteWithdraw(1); + } + + //会长月结 + public function promoteWithdrawPerMonth() + { + $this->promoteWithdraw(2); + } + + //会长提现 $settlement 1-周结算 2-月结算 + private function promoteWithdraw($settlement = 1) { $map['level'] = 1; $map['ver_status'] = 1; + $map['settlement_type'] = $settlement; $promotes = M('promote', 'tab_')->field('id, account, chain')->where($map)->select(); $success = 0; $error_withdraw = 0; diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 9c3ccbb5a..3d77b58a6 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -313,6 +313,10 @@ class PromoteController extends ThinkController if (!empty(I('company_id')) && $promote['level'] ==1) { $data['company_id'] = I('company_id'); } + $settlementType = intval(I('settlement_type', 1)); + if (!empty(I('settlement_type')) && in_array($settlementType, [1, 2])) { + $data['settlement_type'] = $settlementType; + } $res = M("promote", "tab_")->where(array("id"=>$_POST['id']))->save($data); if ($res !== false) { if (!empty(I('company_id')) && $promote['level'] ==1) {//修改会长底下推广员的推广公司 diff --git a/Application/Admin/View/Promote/edit.html b/Application/Admin/View/Promote/edit.html index f7eb7fc90..be7567a07 100644 --- a/Application/Admin/View/Promote/edit.html +++ b/Application/Admin/View/Promote/edit.html @@ -225,6 +225,22 @@ 显示推广员的平台币余额,推广员平台币用于会长代充或者转移给下级推广员 + + + 结算模式: + + + + + + 会长推广结算模式 + + + diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index a61cc0b36..d1437860e 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -340,6 +340,10 @@ class FinanceController extends BaseController $add['widthdraw_number'] = $this->produceWithdrawNumber(); $add['settlement_end_time'] = $thisDay - 1; $add['spend_ids'] = ''; + $add['op_id'] = $this->loginPromote['id']; + $add['op_type'] = 1; + $add['last_op_id'] = $this->loginPromote['id']; + $add['last_op_type'] = 1; M()->startTrans();//开启事物 $withdrawId = M('withdraw', 'tab_')->add($add); @@ -634,6 +638,8 @@ class FinanceController extends BaseController $save['status'] = 0; $save['id'] = $id; + $save['last_op_id'] = $this->loginPromote['id']; + $save['last_op_type'] = 1; $res = M('withdraw', 'tab_')->save($save); if ($res === false) { $data['status'] = 0; @@ -686,6 +692,8 @@ class FinanceController extends BaseController $withdrawSave['status'] = -2; $withdrawSave['spend_ids'] = $spendIds; $withdrawSave['last_up_update_time'] = $time; + $withdrawSave['last_op_id'] = $this->loginPromote['id']; + $withdrawSave['last_op_type'] = 1; M('withdraw', 'tab_')->startTrans();//开启事物 $withdrawRes = M('withdraw', 'tab_')->save($withdrawSave); diff --git a/Data/update.sql b/Data/update.sql index 12a8ead50..38143f20d 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -927,4 +927,9 @@ ALTER TABLE `tab_withdraw` ADD COLUMN `op_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '操作人:1-推广员 2-管理员 3-自动'; ALTER TABLE `tab_withdraw` ADD COLUMN `last_op_id` int(11) NOT NULL DEFAULT 0 COMMENT '最后操作人id', -ADD COLUMN `last_op_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '最后操作人:1-推广员 2-管理员 3-自动'; \ No newline at end of file +ADD COLUMN `last_op_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '最后操作人:1-推广员 2-管理员 3-自动'; + +-- 2019-12-31 +-- 推广员结算类型 cxj +ALTER TABLE `tab_promote` +ADD COLUMN `settlement_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '结算类型:1-周结 2-月结'; \ No newline at end of file