From 51322e331722380eb9b1ebfd219dbdf02d976a9d Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 22 Apr 2020 15:59:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=9A=E5=90=88=E8=B4=A2=E5=8A=A12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateFinanceSetController.class.php | 2 + ...regateFinanceStatementController.class.php | 104 +++++++++--------- .../View/AggregateFinanceStatement/lists.html | 27 ++--- Data/update.sql | 2 + 4 files changed, 67 insertions(+), 68 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceSetController.class.php b/Application/Admin/Controller/AggregateFinanceSetController.class.php index 0a0ac2e05..ebcadee13 100644 --- a/Application/Admin/Controller/AggregateFinanceSetController.class.php +++ b/Application/Admin/Controller/AggregateFinanceSetController.class.php @@ -130,6 +130,8 @@ class AggregateFinanceSetController extends Controller { $v['begintime'] = $begintime; $v['endtime'] = $endtime; $v['create_time'] = time(); + $v['admin_name'] = "system"; + $v['admin_id'] = 0; $Aggregate->add($v); } } diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 90386f757..693b99842 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -17,51 +17,52 @@ class AggregateFinanceStatementController extends ThinkController "5"=>"已到账" ]; public function lists() { - -// $map = []; - -// if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { -// $map['create_time'] = ['between', [strtotime(I('time_start')), strtotime(I('time_end')) + 86399]]; -// } elseif (isset($_REQUEST['time_start'])) { -// $map['create_time'] = ['GT', strtotime(I('time_start'))]; -// } elseif (isset($_REQUEST['time_end'])) { -// $map['create_time'] = ['LT', strtotime(I('time_end')) + 86399]; -// } - -// if ($_REQUEST['verify_status']||$_REQUEST['verify_status']=='0') { -// $map['verify_status'] = $_REQUEST['verify_status']; -// } - -// if ($_REQUEST['statement_type']||$_REQUEST['statement_type']=='0') { -// if($_REQUEST['statement_type']=='2') { -// $map['second_party_info'] = ['like','%"order_type":1%']; -// } else { -// $map['statement_type'] = $_REQUEST['statement_type']; -// if ($_REQUEST['statement_type']=='1') { - -// $map['second_party_info'] = ['like','%"order_type":0%']; - -// } -// } -// // dump($map['second_party_info']);die(); -// } -// // var_dump($map);die(); - -// if ($_REQUEST['company_id']) { -// $map['company_name'] = $_REQUEST['company_id']; -// // if ($_REQUEST['company_id']=='万盟天下科技') { -// // $map['company_name'] = '海南万盟天下科技有限公司'; -// // } -// } - -// $data = M("statement","tab_") -// ->where($map) -// ->order("create_time Desc") -// ->select(); + $is_export= false; + if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ + $is_export = true; + } + + $page = intval(I('get.p', 0)); + $page = $page ? $page : 1; //默认显示第一页数据 + $row = intval(I('row', 0)); + $row = empty($row) ? 10 : $row;//每页条数 + + $map = []; + if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { + $map["_string"] = "(begintime BETWEEN {$_REQUEST['time_start']} AND {$_REQUEST['time_end']}) OR (endtime BETWEEN {$_REQUEST['time_start']} AND {$_REQUEST['time_end']})"; + } elseif (isset($_REQUEST['time_start'])) { + $map["_string"] = "(begintime >= {$_REQUEST['time_start']} ) OR (endtime >= {$_REQUEST['time_end']})"; + } elseif (isset($_REQUEST['time_end'])) { + $map["_string"] = "(begintime <= {$_REQUEST['time_start']} ) OR (endtime <= {$_REQUEST['time_end']})"; + } + if ($_REQUEST['verify_status']) { + $map['verify_status'] = $_REQUEST['verify_status']; + } + if ($_REQUEST['channel_id']) { + $map['channel_id'] = $_REQUEST['channel_id']; + } + if ($_REQUEST['withdraw_type']) { + $map['withdraw_type'] = $_REQUEST['withdraw_type']; + } + $data = M("aggregate_statement","tab_") + ->where($map) + ->order("create_time Desc"); + if($is_export){ + $data = $data->select(); + }else{ + $data = $data->page($page,$row)->select(); + } + foreach($data as $key => $value) { + $data[$key]['verify_status_str'] = $this->verify_status[$value['verify_status']]; + $data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); + $data[$key]['begintime'] = date('Y-m-d H:i:s',$value['begintime']); + $data[$key]['endtime'] = date('Y-m-d H:i:s',$value['endtime']); + } + $count = M("aggregate_statement","tab_")->field("count(id) count,SUM(ratio_money) ratio_money")->where($map)->find(); // // var_dump($data);die(); -// foreach ($data as $key => $value) { -// $data[$key]['order'] = json_decode($value['second_party_info'],true)['order_type']; -// } + // foreach ($data as $key => $value) { + // $data[$key]['order'] = json_decode($value['second_party_info'],true)['order_type']; + // } // $sumData = M("statement","tab_") // ->field('sum(`statement_money`) as sum_money,statement_type') @@ -86,15 +87,16 @@ class AggregateFinanceStatementController extends ThinkController // $this->assign('sum',$handleSumData); // // dump($sumData);die(); + //分页 + $parameter['p'] = $page; + $parameter['row'] = $row; + $page = set_pagination($count, $row, $parameter); + if ($page) { + $this->assign('_page', $page); + } -// foreach($data as $key => $value) { - -// $data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); -// $data[$key]['statement_begin_time'] = date('Y-m-d H:i:s',$value['statement_begin_time']); -// $data[$key]['statement_end_time'] = date('Y-m-d H:i:s',$value['statement_end_time']+86399); -// } // $this->meta_title = '结算单管理'; -// $this->assign('data',$data); + $this->assign('data',$data); $this->assign('channel',$this->getAggChannel()); $this->assign('verify_status',$this->verify_status); $this->display(); diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index f71993f7f..b772bdadc 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -121,13 +121,14 @@ - 对账单类型 - 生成时间 + 对账公司 + 结算方式 对账日期 对账金额 状态 操作人 + 生成时间 操作 @@ -144,13 +145,13 @@ - 上游对账单下游对账单下游补点对账单下游个人结算单 + {$data.channel_name} + 周结月结补点 + {$data.begintime}-{$data.endtime} + {$data.ratio_money} + {$data.verify_status_str} + {$data.admin_name} {$data.create_time} - {$data.company_name} - {$data.statement_begin_time}-{$data.statement_end_time} - {$data.statement_money} - 未审核审核通过审核拒绝 - 未确认确认 查看 @@ -158,6 +159,7 @@ 撤销 + 合计公司对账金额合计:{$sum[1]}     cp对账金额合计:{$sum[0]+$sum[2]} @@ -173,15 +175,6 @@ {$_page|default=''} -
- -
- - -
- 已添加添加至常用设置 -
- diff --git a/Data/update.sql b/Data/update.sql index 62e61bb62..add5e181e 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1636,6 +1636,8 @@ CREATE TABLE `tab_aggregate_statement` ( `first_party_info` longtext DEFAULT NULL COMMENT '甲方相关信息json', `second_party_info` longtext DEFAULT NULL COMMENT '乙方相关信息json', `statement_info` longtext NOT NULL COMMENT '订单相关信息json', + `admin_name` varchar(60) NOT NULL COMMENT '操作人名称', + `admin_id`int(11) DEFAULT '0' COMMENT '操作人id', `verify_status` tinyint(2) DEFAULT '0' COMMENT '审核状态 -1审核拒绝 0:系统生成结算单 1:申请开票 2:审核同意 3:已开票 4:上传收款凭证 5已到账', PRIMARY KEY (`id`), KEY `withdraw_type` (`withdraw_type`) USING BTREE,