diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 678a0b0ba..91ba3c37a 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1552,55 +1552,7 @@ class QueryController extends ThinkController $this->display(); } - public function getPromoteSettlementType() - { - $promoteId = intval(I('post.promote_id', 0)); - $settlementType = []; - if ($promoteId > 0) { - $promote = D('promote')->field('level, settlement_type')->where(array('id' => $promoteId))->find(); - if (empty($promote) || $promote['level'] != 1 || empty($promote['settlement_type'])) { - $settlementType = []; - } else { - $settlementType = WithdrawModel::$settlementTypeList; - unset($settlementType[WithdrawModel::SETTLEMENT_TYPE_OTHER]); - if ($promote['settlement_type'] == 1) { - unset($settlementType[WithdrawModel::SETTLEMENT_TYPE_MONTH]); - } else { - unset($settlementType[WithdrawModel::SETTLEMENT_TYPE_WEEK]); - unset($settlementType[WithdrawModel::SETTLEMENT_TYPE_RECOUP]); - } - } - } - $this->ajaxReturn(['settlement_type' => $settlementType]); - } - - public function getAmountBySettlementType() - { - $withdrawModel = new WithdrawModel(); - $promoteId = intval(I('promote_id', 0)); - $settlementType = intval(I('settlement_type', 0)); - $time = I('time', ''); - - if (empty($promoteId) || !in_array($settlementType, [2, 3])) { - $this->ajaxReturn(['balance' => 0]); - } - - $promote = M('promote', 'tab_')->find($promoteId); - if (empty($promote) || $promote['level'] != 1 || $promote['ver_status'] != 1 || empty($time)) { - $this->ajaxReturn(['balance' => 0]); - } - - $data['begin_time'] = strtotime($time); - $data['end_time'] = strtotime('+1 month', $data['begin_time']) - 1; - - if ($settlementType == 2) { - $balance = $withdrawModel->getMonthAmount($promote, $data); - } else { - $balance = $withdrawModel->getRecoupAmount($promote, $data); - } - $this->ajaxReturn(['balance' => $balance]); - } public function getChannelStream() { $map = []; @@ -1707,4 +1659,5 @@ class QueryController extends ThinkController } $this->ajaxReturn(['balance' => $balance]); } + }