|
|
@ -1552,55 +1552,7 @@ class QueryController extends ThinkController
|
|
|
|
$this->display();
|
|
|
|
$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() {
|
|
|
|
public function getChannelStream() {
|
|
|
|
|
|
|
|
|
|
|
|
$map = [];
|
|
|
|
$map = [];
|
|
|
@ -1707,4 +1659,5 @@ class QueryController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->ajaxReturn(['balance' => $balance]);
|
|
|
|
$this->ajaxReturn(['balance' => $balance]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|