From 30aff2bd38b623601a377a6dfb2f07bc776bef9f Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Mon, 4 Nov 2019 17:23:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=90=8E=E5=8F=B0->=E8=B4=A2?= =?UTF-8?q?=E5=8A=A1=E7=AE=A1=E7=90=86->=E6=96=B0=E5=A2=9E->=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/FinanceController.class.php | 65 ++++- .../View/default/Finance/settlementDtl.html | 222 ++++++++++++++++++ .../View/default/Public/promote_base.html | 2 +- 3 files changed, 287 insertions(+), 2 deletions(-) create mode 100644 Application/Home/View/default/Finance/settlementDtl.html diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index 8296697fe..7689e6548 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -13,5 +13,68 @@ use Base\Repository\UserRepository; */ class FinanceController extends BaseController { - + public function settlementDtl() + { + $model = M('spend', 'tab_'); + $page = intval(I('get.p', 1)); + $page = $page ? $page : 1; //默认显示第一页数据arraypage + $row = intval(I('get.row', 10)); + $payOrderNumber = I('pay_order_number', ''); + $nowTime = date('Y-m-d'); + $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); + $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); + $initEndTime = $nowTime; + $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); + $begTime = strtotime($initBegTime); + $endTime = strtotime($initEndTime); + $loginPromote = $this->getLoginPromote(); + + $parameter['p'] = $page; + $parameter['row'] = $row; + $parameter['pay_order_number'] = $payOrderNumber; + $parameter['begtime'] = $initBegTime; + $parameter['endtime'] = $initEndTime; + + $map['chain'] = ['like', $loginPromote['chain'] . $loginPromote['id'] . '/%']; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); + $ids[] = $loginPromote['id']; + $ids = implode(',', $ids); +// var_dump($ids); +// die; + + $map = []; + $map['promote_id'] = ['in', $ids]; + 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,selle_ratio,convert(pay_amount*selle_ratio,decimal(10,2)) as income,pay_time,pay_status') + ->where($map) + ->order('id desc') + ->page($page, $row) + ->select(); + $count = $model->where($map)->count(); + + foreach ($data as &$list) { + $list['pay_status'] = ($list['pay_status'] == 0) ? '失败' : '成功'; + $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']); + } + + $page = set_pagination($count, $row, $parameter); + + $this->assign('listData', $data); + $this->assign('count', $count); + $this->assign('initBegTime', $initBegTime); + $this->assign('initEndTime', $initEndTime); + $this->assign('_page', $page); + $this->assign('meta_title', '结算明细'); + $this->display(); + } } \ No newline at end of file diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html new file mode 100644 index 000000000..945ef77df --- /dev/null +++ b/Application/Home/View/default/Finance/settlementDtl.html @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index 957810bd0..8c3a509e5 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -72,7 +72,7 @@