|
|
|
@ -97,6 +97,9 @@ class FinanceController extends BaseController
|
|
|
|
|
$endTime = strtotime($initEndTime);
|
|
|
|
|
$endTime = $endTime + 3600 * 24;
|
|
|
|
|
|
|
|
|
|
$records = [];
|
|
|
|
|
$income = [];
|
|
|
|
|
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
|
|
|
|
|
$map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%'];
|
|
|
|
|
$promoteIds = M('promote', 'tab_')->where($map)->getField('id', true);
|
|
|
|
|
$promoteIds[] = $this->loginPromote['id'];
|
|
|
|
@ -132,6 +135,7 @@ class FinanceController extends BaseController
|
|
|
|
|
'url' => U('settlementDtl', array('begtime' => $day, 'endtime' => $day))
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->assign('income', $income);
|
|
|
|
|
$this->assign('listData', $records);
|
|
|
|
@ -164,6 +168,7 @@ class FinanceController extends BaseController
|
|
|
|
|
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
|
|
|
|
|
$begTime = strtotime($initBegTime);
|
|
|
|
|
$endTime = strtotime($initEndTime);
|
|
|
|
|
$endTime += 3600 * 24;
|
|
|
|
|
|
|
|
|
|
$parameter['p'] = $page;
|
|
|
|
|
$parameter['row'] = $row;
|
|
|
|
@ -171,6 +176,9 @@ class FinanceController extends BaseController
|
|
|
|
|
$parameter['begtime'] = $initBegTime;
|
|
|
|
|
$parameter['endtime'] = $initEndTime;
|
|
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
|
$count = 0;
|
|
|
|
|
if (intval($endTime - $begTime) / (24 * 3600) <= 31) {
|
|
|
|
|
$map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%'];
|
|
|
|
|
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
|
|
|
|
|
$ids[] = $this->loginPromote['id'];
|
|
|
|
@ -178,16 +186,10 @@ class FinanceController extends BaseController
|
|
|
|
|
|
|
|
|
|
$map = [];
|
|
|
|
|
$map['promote_id'] = ['in', $ids];
|
|
|
|
|
$map['pay_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
|
if (!empty($payOrderNumber)) {
|
|
|
|
|
$map['pay_order_number'] = $payOrderNumber;
|
|
|
|
|
}
|
|
|
|
|
if (!empty($begTime) && empty($endTime)) {
|
|
|
|
|
$map['pay_time'] = ['egt', $begTime];
|
|
|
|
|
} elseif (empty($begTime) && !empty($endTime)) {
|
|
|
|
|
$map['pay_time'] = ['elt', $endTime + 86399];
|
|
|
|
|
} elseif (!empty($begTime) && !empty($endTime)) {
|
|
|
|
|
$map['pay_time'] = ['between', [$begTime, $endTime + 86399]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id')
|
|
|
|
|
->where($map)
|
|
|
|
@ -229,6 +231,7 @@ class FinanceController extends BaseController
|
|
|
|
|
$list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2);
|
|
|
|
|
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$page = set_pagination($count, $row, $parameter);
|
|
|
|
|
|
|
|
|
|