From 95cd9993e2749fbf64bfbecda0694917bfd61695 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 21 Apr 2020 15:46:36 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E8=B4=A2=E5=8A=A11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateFinanceSetController.class.php | 320 ++++++++++++++++++ Data/update.sql | 36 ++ 2 files changed, 356 insertions(+) create mode 100644 Application/Admin/Controller/AggregateFinanceSetController.class.php diff --git a/Application/Admin/Controller/AggregateFinanceSetController.class.php b/Application/Admin/Controller/AggregateFinanceSetController.class.php new file mode 100644 index 000000000..425081ecc --- /dev/null +++ b/Application/Admin/Controller/AggregateFinanceSetController.class.php @@ -0,0 +1,320 @@ +field("value")->where("`key` = 'aggregate_finance_api'")->find(); + if(empty($apihost)){ + echo "请先设置请求接口aggregate_finance_api的值".PHP_EOL;die; + } + $this->apihost = $apihost['value']; + //初始化 + // $this->UserModel =M("User","tab_"); + // $this->LoginModel =M("user_login_record","tab_"); + // $this->SpendModel =M("spend","tab_"); + // $this->PromoteModel =M("promote","tab_"); + // $this->model =M(); + // $this->PromoteCountModel =M("PromoteCount","tab_"); + // $this->GameCountModel =M("GameCount","tab_"); + // $this->nowdata =time(); + + // $group_concat_max_len = M()->execute("SET SESSION group_concat_max_len = 4294967295"); + // echo "set group_concat_max_len ok,beging count".PHP_EOL; + // if(I("reset")) $this->reset = true; + + + } + public function setDaliyCount() + { + $w = (int)date("w"); + $d = (int)date("d"); + + + $this->setDateCount($begin); + } + public function setWeekCount()//进行周结 + { + echo $this->apihost; + # code... + } + + + + + + + + + + + + + + + + + + + + + + + + + + public function setFreeDateCount($begin,$end='') + { + if($end == '') $end = $begin; + //判断日期格式 + $patten = "/^\d{4}[\-](0?[1-9]|1[012])[\-](0?[1-9]|[12][0-9]|3[01])$/"; + if (!preg_match($patten, $begin)) { + die("开始时间格式错误"); + } + if (!preg_match($patten, $end)) { + die("结束时间格式错误"); + } + if(strtotime($end) < strtotime($begin)){ + die("结束时间不能比开始时间小"); + } + if(strtotime($end)+86399 > time()){ + die("结束时间不能包含今日"); + } + if($begin == $end){ + $this->setDateCount($begin); + }else{ + $starttime = $begin?strtotime($begin):mktime(0,0,0,date('m'),date('d')-1,date('Y')); + $endtime = $end?strtotime($end)+86399:$starttime+86399; + $datelist = get_date_list($starttime,$endtime,1); + $countdate = count($datelist); + for($i=0;$i<$countdate;$i++){ + $this->setDateCount($datelist[$i]); + } + } + + } + public function setDateCount($date) + { + $this->date = $date; + $tarry = explode('-',$date); + $this->beginTime=mktime(0,0,0,$tarry[1],$tarry[2],$tarry[0]); + $this->endTime=mktime(0,0,0,$tarry[1],$tarry[2]-0+1,$tarry[0])-1; + set_time_limit(0); + $t1 = microtime(true); + //判断是否存在 + $PromoteRes = $this->PromoteCountModel->where("date = '{$this->beginTime}'")->find(); + $GameRes = $this->GameCountModel->where("date = '{$this->beginTime}'")->find(); + $reset=''; + if(!empty($PromoteRes) || !empty($GameRes) ){ + if($this->reset){ + $this->PromoteCountModel->where("date = '{$this->beginTime}'")->delete(); + $this->GameCountModel->where("date = '{$this->beginTime}'")->delete(); + $reset = "reset and creat "; + }else{ + echo ("{$this->date} 已统计,请勿重复提交".PHP_EOL); + return; + } + } + $this->model->startTrans(); + $this->addid = []; + $this->adddata = []; + $this->promoteNew(); + $this->promotePayMoeny(); + $this->promoteActive(); + $this->promoteCreateDb(); + // unset($this->addid); + // unset($this->adddata); + $this->gameid = []; + $this->gamedata = []; + $this->gameNew(); + $this->gamePayMoeny(); + $this->gameActive(); + $this->gameCreateDb(); + $this->model->commit(); + $t2 = microtime(true); + echo ("{$this->date} {$reset}success runtime:".round($t2-$t1,3).'s'.PHP_EOL); + # code... + } + + //=======================聚合推广员======================== + //1聚合新增 + public function promoteNew() + { + $map = ['register_time'=>['between',[$this->beginTime,$this->endTime]],"puid"=>0,"promote_id"=>["gt",0]]; + $promoteNew = $this->UserModel->field('COUNT(1) AS new_user_count,promote_id,promote_account') + ->where($map) + ->group("promote_id") + ->select(); + $count = count($promoteNew); + for ($i=0; $i < $count; $i++) { + $this->addid[] = $promoteNew[$i]["promote_id"]; + $this->adddata[$promoteNew[$i]["promote_id"]] = $promoteNew[$i]; + } + unset($promoteNew); + } + //2聚合付费 + public function promotePayMoeny() + { + $map = ['pay_time'=>['between',[$this->beginTime,$this->endTime]],"pay_status"=>1,"promote_id"=>["gt",0]];//1支付成功 + $promotePayMoeny = $this->SpendModel->field('sum(pay_amount) AS pay_money_count,promote_id,promote_account') + ->where($map) + ->group("promote_id") + ->select(); + $count = count($promotePayMoeny); + for ($i=0; $i < $count; $i++) { + if (in_array($promotePayMoeny[$i]["promote_id"],$this->addid)) { + //存在 + $this->adddata[$promotePayMoeny[$i]["promote_id"]]["pay_money_count"] = $promotePayMoeny[$i]["pay_money_count"]; + }else{ + $this->addid[] = $promotePayMoeny[$i]["promote_id"]; + $this->adddata[$promotePayMoeny[$i]["promote_id"]] = $promotePayMoeny[$i]; + } + } + unset($promotePayMoeny); + } + //3聚合活跃 + public function promoteActive() + { + $map = ['login_time'=>['between',[$this->beginTime,$this->endTime]],"promote_id"=>["gt",0]];//0不是小号 + $promoteActive = $this->LoginModel->field('COUNT(DISTINCT user_id) AS active_user_count,GROUP_CONCAT(DISTINCT user_id) active_user_list,promote_id') + ->where($map) + ->group("promote_id") + ->select(); + $count = count($promoteActive); + for ($i=0; $i < $count; $i++) { + if (in_array($promoteActive[$i]["promote_id"],$this->addid)) { + //存在 + $this->adddata[$promoteActive[$i]["promote_id"]]["active_user_count"] = $promoteActive[$i]["active_user_count"]; + $this->adddata[$promoteActive[$i]["promote_id"]]["active_user_list"] = $promoteActive[$i]["active_user_list"]; + }else{ + $this->addid[] = $promoteActive[$i]["promote_id"]; + $this->adddata[$promoteActive[$i]["promote_id"]] = $promoteActive[$i]; + } + } + unset($promoteActive); + } + //4加入数据库 + public function promoteCreateDb() + { + $count = count($this->addid); + if ($count > 0) { + foreach ($this->adddata as $key => $value) { + $value['date']=$this->beginTime; + $value['create_time']=$this->nowdata; + $value['active_user_list'] = @json_encode(array_map("intFun",explode(",",$value['active_user_list']))); + if(empty($value['promote_account']) && $value['promote_id']){ + if($value['promote_id'] == 0){ + $value['promote_account'] = "官方渠道"; + }else{ + $value['promote_account'] = $this->PromoteModel->field("account")->where("id = {$value['promote_id']}")->find()['account']; + if(!$value['promote_account']){ + $value['promote_account']="未知推广员"; + } + } + } + $tempdbres = $this->PromoteCountModel->add($value); + if($tempdbres === false){ + $this->model->rollback(); + die("error"); + } + } + } + } + //=======================聚合游戏======================== + //1聚合新增 + public function gameNew() + { + $map = ['register_time'=>['between',[$this->beginTime,$this->endTime]],"puid"=>0,"fgame_id"=>["gt",0]];//0不是小号 + $gameNew = $this->UserModel->field('COUNT(1) AS new_user_count,fgame_id game_id,fgame_name game_name') + ->where($map) + ->group("fgame_id") + ->select(); + $count = count($gameNew); + for ($i=0; $i < $count; $i++) { + $this->gameid[] = $gameNew[$i]["game_id"]; + $this->gamedata[$gameNew[$i]["game_id"]] = $gameNew[$i]; + } + unset($gameNew); + } + //2聚合付费 + public function gamePayMoeny() + { + $map = ['pay_time'=>['between',[$this->beginTime,$this->endTime]],"pay_status"=>1,"game_id"=>["gt",0]];//1支付成功 + $gamePayMoeny = $this->SpendModel->field('sum(pay_amount) AS pay_money_count,game_id,game_name') + ->where($map) + ->group("game_id") + ->select(); + $count = count($gamePayMoeny); + for ($i=0; $i < $count; $i++) { + if (in_array($gamePayMoeny[$i]["game_id"],$this->gameid)) { + //存在 + $this->gamedata[$gamePayMoeny[$i]["game_id"]]["pay_money_count"] = $gamePayMoeny[$i]["pay_money_count"]; + }else{ + $this->gameid[] = $gamePayMoeny[$i]["game_id"]; + $this->gamedata[$gamePayMoeny[$i]["game_id"]] = $gamePayMoeny[$i]; + } + } + unset($gamePayMoeny); + } + //3聚合活跃 + public function gameActive() + { + $map = ['login_time'=>['between',[$this->beginTime,$this->endTime]],"game_id"=>["gt",0]];//0不是小号 + $gameActive = $this->LoginModel->field('COUNT(DISTINCT user_id) AS active_user_count,GROUP_CONCAT(DISTINCT user_id) active_user_list,game_id,game_name') + ->where($map) + ->group("game_id") + ->select(); + $count = count($gameActive); + for ($i=0; $i < $count; $i++) { + if (in_array($gameActive[$i]["game_id"],$this->gameid)) { + //存在 + $this->gamedata[$gameActive[$i]["game_id"]]["active_user_count"] = $gameActive[$i]["active_user_count"]; + $this->gamedata[$gameActive[$i]["game_id"]]["active_user_list"] = $gameActive[$i]["active_user_list"]; + }else{ + $this->gameid[] = $gameActive[$i]["game_id"]; + $this->gamedata[$gameActive[$i]["game_id"]] = $gameActive[$i]; + } + } + unset($gameActive); + } + //4加入数据库 + public function gameCreateDb() + { + $count = count($this->gameid); + if ($count > 0) { + foreach ($this->gamedata as $key => $value) { + $value['date']=$this->beginTime; + $value['create_time']=$this->nowdata; + $value['active_user_list'] = @json_encode(array_map("intFun",explode(",",$value['active_user_list']))); + $tempdbres = $this->GameCountModel->add($value); + if($tempdbres === false){ + $this->model->rollback(); + die("error"); + } + } + } + } + +} diff --git a/Data/update.sql b/Data/update.sql index ea4f7764f..3e34bd927 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1605,3 +1605,39 @@ CREATE TABLE `tab_finance_compare_info` ( KEY `pay_way` (`pay_way`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='财务导入对账详情表'; + +--新增参数kv表 +CREATE TABLE `sys_kv` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `key` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT 'key', + `value` varchar(1000) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT 'value', + `type` varchar(50) DEFAULT NULL COMMENT '类型说明', + `remark` varchar(1000) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`), + UNIQUE KEY `key_name` (`key`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='系统简单kv储存表'; + +INSERT INTO `platform`.`sys_kv` (`key`, `value`, `type`, `remark`) VALUES ('aggregate_finance_api', 'http://admin.cz.com/index.php?g=api&m=FinanceWeekCount&a=returnFinanceAccountsDataList', 'string', '聚合下游结算Api地址'); + + +CREATE TABLE `tab_aggregate_statement` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键', + `statement_type` tinyint(2) DEFAULT '0' COMMENT '对账类型(0-周结,1月结,2补点)', + `company_id` int(11) DEFAULT '0' COMMENT '对账公司id', + `company_name` varchar(60) NOT NULL COMMENT '对账公司名称', + `link_phone` varchar(24) DEFAULT NULL COMMENT '对账公司联系人电话', + `statement_begin_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账开始时间', + `statement_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账截止时间', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建对账单时间', + `statement_money` decimal(10,2) DEFAULT '0.00' COMMENT '对账金额', + `pay_amount` decimal(10,2) DEFAULT '0.00' COMMENT '原始金额合计', + `ext_field` longtext COMMENT '凭证地址', + `first_party_info` longtext NOT NULL COMMENT '甲方相关信息json', + `second_party_info` longtext NOT NULL COMMENT '乙方相关信息json', + `statement_info` longtext NOT NULL COMMENT '订单相关信息json', + `verify_status` tinyint(2) DEFAULT '0' COMMENT '审核状态 0:未审核 1:审核通过 2:审核拒绝', + PRIMARY KEY (`id`), + KEY `statement_type` (`statement_type`) USING BTREE, + KEY `company_id` (`company_id`) USING BTREE, + KEY `link_phone` (`link_phone`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='cp/公会对账单'; \ No newline at end of file From 73ac725950e737fce9ee18e4940a149a4ac99ce2 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 22 Apr 2020 10:26:20 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E8=84=9A=E6=9C=ACok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateFinanceSetController.class.php | 187 +++++++++++------- Data/update.sql | 27 +-- 2 files changed, 134 insertions(+), 80 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceSetController.class.php b/Application/Admin/Controller/AggregateFinanceSetController.class.php index 425081ecc..0a0ac2e05 100644 --- a/Application/Admin/Controller/AggregateFinanceSetController.class.php +++ b/Application/Admin/Controller/AggregateFinanceSetController.class.php @@ -8,22 +8,8 @@ use Think\Controller; * @author cz */ class AggregateFinanceSetController extends Controller { - // public $beginTime; - // public $endTime; - // public $date; - // public $nowdata; - // public $UserModel; - // public $ChartModel; - // public $LoginModel; - // public $SpendModel; - // public $PromoteModel; - // public $GameCountModel; - // public $addid; - // public $adddata; - // public $gameid; - // public $gamedata; - // public $reset=false; public $apihost; + public $token = "LYHTQDJS"; public function _initialize(){ $apihost = M("Kv")->field("value")->where("`key` = 'aggregate_finance_api'")->find(); @@ -31,34 +17,130 @@ class AggregateFinanceSetController extends Controller { echo "请先设置请求接口aggregate_finance_api的值".PHP_EOL;die; } $this->apihost = $apihost['value']; - //初始化 - // $this->UserModel =M("User","tab_"); - // $this->LoginModel =M("user_login_record","tab_"); - // $this->SpendModel =M("spend","tab_"); - // $this->PromoteModel =M("promote","tab_"); - // $this->model =M(); - // $this->PromoteCountModel =M("PromoteCount","tab_"); - // $this->GameCountModel =M("GameCount","tab_"); - // $this->nowdata =time(); - - // $group_concat_max_len = M()->execute("SET SESSION group_concat_max_len = 4294967295"); - // echo "set group_concat_max_len ok,beging count".PHP_EOL; - // if(I("reset")) $this->reset = true; - + } + public function setFreeDateCount($begin,$end='') + { + if($end == '') $end = $begin; + //判断日期格式 + $patten = "/^\d{4}[\-](0?[1-9]|1[012])[\-](0?[1-9]|[12][0-9]|3[01])$/"; + if (!preg_match($patten, $begin)) { + die("开始时间格式错误"); + } + if (!preg_match($patten, $end)) { + die("结束时间格式错误"); + } + if(strtotime($end) < strtotime($begin)){ + die("结束时间不能比开始时间小"); + } + if(strtotime($end)+86399-24*3600 > time()){ + die("结束时间不能大于当前"); + } + $starttime = $begin?strtotime($begin):mktime(0,0,0,date('m'),date('d'),date('Y')); + $endtime = $end?strtotime($end)+86399:$starttime+86399; + $datelist = get_date_list($starttime,$endtime,1); + $countdate = count($datelist); + for($i=0;$i<$countdate;$i++){ + $this->setDailyCount($datelist[$i]); + } } - public function setDaliyCount() + public function setDailyCount($stime="now") { - $w = (int)date("w"); - $d = (int)date("d"); - + if($stime=="now"){ + $stime=time(); + }else{ + $stime = strtotime($stime); + } + $nowdate = date("Y-m-d",$stime); + $w = (int)date("w",$stime); + $d = (int)date("d",$stime); + + if($w == 1 || $d == 1){ + if($w == 1){ + echo $nowdate.":".PHP_EOL; + echo "--周结begin".PHP_EOL; + $this->setWeekCount($stime); + } + if($d == 1){ + echo $nowdate.":".PHP_EOL; + echo "--月结&补点begin".PHP_EOL; + $this->setMonthCount($stime); + } + }else{ + echo $nowdate."非周一和月初,无需任何处理".PHP_EOL; + } + } + public function setWeekCount($stime)//进行周结 + { + $begintime = mktime(0,0,0,date('m',$stime),date('d',$stime)-7,date('Y',$stime)); + $endtime = mktime(0,0,0,date('m',$stime),date('d',$stime),date('Y',$stime))-1; + $this->getAndSaveData(0,$begintime,$endtime); + } + public function setMonthCount($stime)//进行周结 + { + $thismonth = date('m',$stime); + $thisyear = date('Y',$stime); + if ($thismonth == 1) { + $lastmonth = 12; + $lastyear = $thisyear - 1; + } else { + $lastmonth = $thismonth - 1; + $lastyear = $thisyear; + } + $lastStartDay = $lastyear . '-' . $lastmonth . '-1'; + $lastEndDay = $lastyear . '-' . $lastmonth . '-' . date('t', strtotime($lastStartDay)); + $begintime = strtotime($lastStartDay);//上个月的月初时间戳 + $endtime = strtotime($lastEndDay)+24*3600-1;//上个月的月末时间戳 + //普通月结 + $this->getAndSaveData(1,$begintime,$endtime); + //补点 + $this->getAndSaveData(2,$begintime,$endtime); - $this->setDateCount($begin); } - public function setWeekCount()//进行周结 + protected function getAndSaveData($type,$begintime,$endtime) { - echo $this->apihost; - # code... + $sign = md5($begintime.$endtime.$type.$this->token); + $arr = [ + "begintime"=>$begintime, + "endtime"=>$endtime, + "type"=>$type, + "sign"=>$sign + ]; + $dataurl .= $this->apihost."&".http_build_query($arr); + $html = file_get_contents($dataurl); + $rsp = json_decode($html,true); + var_dump($dataurl); + if($rsp['code'] != 1){ + echo $rsp['error'].PHP_EOL;die; + } + //成功插入 + $Aggregate = M("aggregate_statement","tab_"); + $begintimestr = date("Y-m-d",$begintime); + $endtimestr = date("Y-m-d",$endtime); + if($rsp['count'] > 0){ + //插入数据 + foreach ($rsp['data'] as $k => $v) { + foreach ($v["game_list"] as $ke => &$va) { + $va['begintime'] = $begintimestr; + $va['endtime'] = $endtimestr; + $va['fax_ratio'] = 0; + } + $v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE); + unset($v["game_list"]); + $v['begintime'] = $begintime; + $v['endtime'] = $endtime; + $v['create_time'] = time(); + $Aggregate->add($v); + } + } + + if($type == 0){ + echo "----周结统计ok".PHP_EOL; + }elseif($type == 1){ + echo "----月结统计ok".PHP_EOL; + }elseif($type == 2){ + echo "----补点统计ok".PHP_EOL; + } } @@ -85,36 +167,7 @@ class AggregateFinanceSetController extends Controller { - public function setFreeDateCount($begin,$end='') - { - if($end == '') $end = $begin; - //判断日期格式 - $patten = "/^\d{4}[\-](0?[1-9]|1[012])[\-](0?[1-9]|[12][0-9]|3[01])$/"; - if (!preg_match($patten, $begin)) { - die("开始时间格式错误"); - } - if (!preg_match($patten, $end)) { - die("结束时间格式错误"); - } - if(strtotime($end) < strtotime($begin)){ - die("结束时间不能比开始时间小"); - } - if(strtotime($end)+86399 > time()){ - die("结束时间不能包含今日"); - } - if($begin == $end){ - $this->setDateCount($begin); - }else{ - $starttime = $begin?strtotime($begin):mktime(0,0,0,date('m'),date('d')-1,date('Y')); - $endtime = $end?strtotime($end)+86399:$starttime+86399; - $datelist = get_date_list($starttime,$endtime,1); - $countdate = count($datelist); - for($i=0;$i<$countdate;$i++){ - $this->setDateCount($datelist[$i]); - } - } - - } + public function setDateCount($date) { $this->date = $date; diff --git a/Data/update.sql b/Data/update.sql index 3e34bd927..4b7f8a2d7 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1622,22 +1622,23 @@ INSERT INTO `platform`.`sys_kv` (`key`, `value`, `type`, `remark`) VALUES ('aggr CREATE TABLE `tab_aggregate_statement` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键', - `statement_type` tinyint(2) DEFAULT '0' COMMENT '对账类型(0-周结,1月结,2补点)', - `company_id` int(11) DEFAULT '0' COMMENT '对账公司id', - `company_name` varchar(60) NOT NULL COMMENT '对账公司名称', + `withdraw_type` tinyint(2) DEFAULT '0' COMMENT '对账类型(0-周结,1月结,2补点)', + `channel_id` int(11) DEFAULT '0' COMMENT '对账公司id', + `channel_name` varchar(60) NOT NULL COMMENT '对账公司名称', `link_phone` varchar(24) DEFAULT NULL COMMENT '对账公司联系人电话', - `statement_begin_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账开始时间', - `statement_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账截止时间', + `begintime` int(11) NOT NULL DEFAULT '0' COMMENT '对账开始时间', + `endtime` int(11) NOT NULL DEFAULT '0' COMMENT '对账截止时间', `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建对账单时间', - `statement_money` decimal(10,2) DEFAULT '0.00' COMMENT '对账金额', - `pay_amount` decimal(10,2) DEFAULT '0.00' COMMENT '原始金额合计', + `ratio_money` decimal(10,2) DEFAULT '0.00' COMMENT '对账金额', + `pay_money` decimal(10,2) DEFAULT '0.00' COMMENT '原始金额合计', + `pay_type` tinyint(2) DEFAULT '0' COMMENT '收款方(0-甲方付给乙方,乙方收款;1-乙方付给甲方,甲方收款)', `ext_field` longtext COMMENT '凭证地址', - `first_party_info` longtext NOT NULL COMMENT '甲方相关信息json', - `second_party_info` longtext NOT NULL COMMENT '乙方相关信息json', + `first_party_info` longtext DEFAULT NULL COMMENT '甲方相关信息json', + `second_party_info` longtext DEFAULT NULL COMMENT '乙方相关信息json', `statement_info` longtext NOT NULL COMMENT '订单相关信息json', - `verify_status` tinyint(2) DEFAULT '0' COMMENT '审核状态 0:未审核 1:审核通过 2:审核拒绝', + `verify_status` tinyint(2) DEFAULT '0' COMMENT '审核状态 -1审核拒绝 0:系统生成结算单 1:申请开票 2:审核同意 3:已开票 4:上传收款凭证 5已到账', PRIMARY KEY (`id`), - KEY `statement_type` (`statement_type`) USING BTREE, - KEY `company_id` (`company_id`) USING BTREE, + KEY `withdraw_type` (`withdraw_type`) USING BTREE, + KEY `channel_id` (`channel_id`) USING BTREE, KEY `link_phone` (`link_phone`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='cp/公会对账单'; \ No newline at end of file +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='聚合渠道结算单'; \ No newline at end of file From 6d0e7c3a00ab1c50f3925169f8265ee9206f2faa Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 22 Apr 2020 13:54:34 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E5=AF=B9=E8=B4=A61?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 111 +++ .../View/AggregateFinanceStatement/lists.html | 673 ++++++++++++++++++ Data/update.sql | 4 +- 3 files changed, 786 insertions(+), 2 deletions(-) create mode 100644 Application/Admin/Controller/AggregateFinanceStatementController.class.php create mode 100644 Application/Admin/View/AggregateFinanceStatement/lists.html diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php new file mode 100644 index 000000000..90386f757 --- /dev/null +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -0,0 +1,111 @@ +"审核拒绝", + "0"=>"未申请开票", + "1"=>"申请开票", + "2"=>"审核同意", + "3"=>"已开票", + "4"=>"上传收款凭证", + "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(); +// // var_dump($data);die(); +// 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') +// ->where($map) +// ->group('statement_type') +// ->select(); + +// $handleSumData = []; +// foreach ($sumData as $key => $value) { + +// $handleSumData[$value['statement_type']] = $value['sum_money']; +// } +// if (!$handleSumData[1]) { +// $handleSumData[1] = 0; +// } + +// if (!$handleSumData[0]) { +// $handleSumData[0] = 0; +// } + + +// $this->assign('sum',$handleSumData); +// // dump($sumData);die(); + + +// 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('channel',$this->getAggChannel()); + $this->assign('verify_status',$this->verify_status); + $this->display(); + + } + //获取所有下游渠道 + public function getAggChannel() + { + return M("aggregate_statement","tab_")->field("channel_id,channel_name")->group("channel_id")->select(); + # code... + } + + +} diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html new file mode 100644 index 000000000..f71993f7f --- /dev/null +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -0,0 +1,673 @@ + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+ +
+ +
+ +  -  +
+ + +
+
+ +
+ +
+ + + +
+ 搜索 +
+ +
+
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
对账单类型生成时间对账公司对账日期对账金额状态操作人操作
aOh! 暂时还没有内容!
+ 上游对账单下游对账单下游补点对账单下游个人结算单{$data.create_time}{$data.company_name}{$data.statement_begin_time}-{$data.statement_end_time}{$data.statement_money}未审核审核通过审核拒绝未确认确认 + 查看 + + 编辑 + + 撤销 +
合计公司对账金额合计:{$sum[1]}     cp对账金额合计:{$sum[0]+$sum[2]}
+
+ +
+
+ + 导出 + + {$_page|default=''} +
+ + +
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ' + + '; + + + + + + + + + + diff --git a/Data/update.sql b/Data/update.sql index 4b7f8a2d7..62e61bb62 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1606,7 +1606,7 @@ CREATE TABLE `tab_finance_compare_info` ( ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='财务导入对账详情表'; ---新增参数kv表 +--新增参数kv表 chenzhi 20200422 CREATE TABLE `sys_kv` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `key` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT 'key', @@ -1619,7 +1619,7 @@ CREATE TABLE `sys_kv` ( INSERT INTO `platform`.`sys_kv` (`key`, `value`, `type`, `remark`) VALUES ('aggregate_finance_api', 'http://admin.cz.com/index.php?g=api&m=FinanceWeekCount&a=returnFinanceAccountsDataList', 'string', '聚合下游结算Api地址'); - +--聚合渠道结算单 chenzhi 20200422 CREATE TABLE `tab_aggregate_statement` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键', `withdraw_type` tinyint(2) DEFAULT '0' COMMENT '对账类型(0-周结,1月结,2补点)', From 51322e331722380eb9b1ebfd219dbdf02d976a9d Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 22 Apr 2020 15:59:11 +0800 Subject: [PATCH 04/20] =?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, From 114cf4a503de40150214c0bcd470677ad78891cc Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 22 Apr 2020 17:59:32 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E5=AF=B9=E8=B4=A6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=B9=E8=B4=A6=E9=87=91=E9=A2=9D=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/AggregateFinanceStatementController.class.php | 3 ++- Application/Admin/View/AggregateFinanceStatement/lists.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 693b99842..ea6dd83b4 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -90,13 +90,14 @@ class AggregateFinanceStatementController extends ThinkController //分页 $parameter['p'] = $page; $parameter['row'] = $row; - $page = set_pagination($count, $row, $parameter); + $page = set_pagination($count['count'], $row, $parameter); if ($page) { $this->assign('_page', $page); } // $this->meta_title = '结算单管理'; $this->assign('data',$data); + $this->assign('total',$count['ratio_money']); $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 b772bdadc..cc620bd31 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -162,7 +162,7 @@ - 合计公司对账金额合计:{$sum[1]}     cp对账金额合计:{$sum[0]+$sum[2]} + 合计对账金额:{$total} From bf7c7ed14f22a4b9e753162345c93c17731b341c Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 23 Apr 2020 19:39:27 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateFinanceSetController.class.php | 227 +---- ...regateFinanceStatementController.class.php | 160 +++- .../createStatement.html | 896 ++++++++++++++++++ .../editStatement.html | 896 ++++++++++++++++++ .../View/AggregateFinanceStatement/lists.html | 201 ++-- 5 files changed, 2039 insertions(+), 341 deletions(-) create mode 100644 Application/Admin/View/AggregateFinanceStatement/createStatement.html create mode 100644 Application/Admin/View/AggregateFinanceStatement/editStatement.html diff --git a/Application/Admin/Controller/AggregateFinanceSetController.class.php b/Application/Admin/Controller/AggregateFinanceSetController.class.php index ebcadee13..ce92f5dd1 100644 --- a/Application/Admin/Controller/AggregateFinanceSetController.class.php +++ b/Application/Admin/Controller/AggregateFinanceSetController.class.php @@ -132,6 +132,9 @@ class AggregateFinanceSetController extends Controller { $v['create_time'] = time(); $v['admin_name'] = "system"; $v['admin_id'] = 0; + $v['second_party_info'] = json_encode([ + "partner"=>$v['channel_name'] + ],JSON_UNESCAPED_UNICODE); $Aggregate->add($v); } } @@ -147,229 +150,5 @@ class AggregateFinanceSetController extends Controller { - - - - - - - - - - - - - - - - - - - - - - - - public function setDateCount($date) - { - $this->date = $date; - $tarry = explode('-',$date); - $this->beginTime=mktime(0,0,0,$tarry[1],$tarry[2],$tarry[0]); - $this->endTime=mktime(0,0,0,$tarry[1],$tarry[2]-0+1,$tarry[0])-1; - set_time_limit(0); - $t1 = microtime(true); - //判断是否存在 - $PromoteRes = $this->PromoteCountModel->where("date = '{$this->beginTime}'")->find(); - $GameRes = $this->GameCountModel->where("date = '{$this->beginTime}'")->find(); - $reset=''; - if(!empty($PromoteRes) || !empty($GameRes) ){ - if($this->reset){ - $this->PromoteCountModel->where("date = '{$this->beginTime}'")->delete(); - $this->GameCountModel->where("date = '{$this->beginTime}'")->delete(); - $reset = "reset and creat "; - }else{ - echo ("{$this->date} 已统计,请勿重复提交".PHP_EOL); - return; - } - } - $this->model->startTrans(); - $this->addid = []; - $this->adddata = []; - $this->promoteNew(); - $this->promotePayMoeny(); - $this->promoteActive(); - $this->promoteCreateDb(); - // unset($this->addid); - // unset($this->adddata); - $this->gameid = []; - $this->gamedata = []; - $this->gameNew(); - $this->gamePayMoeny(); - $this->gameActive(); - $this->gameCreateDb(); - $this->model->commit(); - $t2 = microtime(true); - echo ("{$this->date} {$reset}success runtime:".round($t2-$t1,3).'s'.PHP_EOL); - # code... - } - - //=======================聚合推广员======================== - //1聚合新增 - public function promoteNew() - { - $map = ['register_time'=>['between',[$this->beginTime,$this->endTime]],"puid"=>0,"promote_id"=>["gt",0]]; - $promoteNew = $this->UserModel->field('COUNT(1) AS new_user_count,promote_id,promote_account') - ->where($map) - ->group("promote_id") - ->select(); - $count = count($promoteNew); - for ($i=0; $i < $count; $i++) { - $this->addid[] = $promoteNew[$i]["promote_id"]; - $this->adddata[$promoteNew[$i]["promote_id"]] = $promoteNew[$i]; - } - unset($promoteNew); - } - //2聚合付费 - public function promotePayMoeny() - { - $map = ['pay_time'=>['between',[$this->beginTime,$this->endTime]],"pay_status"=>1,"promote_id"=>["gt",0]];//1支付成功 - $promotePayMoeny = $this->SpendModel->field('sum(pay_amount) AS pay_money_count,promote_id,promote_account') - ->where($map) - ->group("promote_id") - ->select(); - $count = count($promotePayMoeny); - for ($i=0; $i < $count; $i++) { - if (in_array($promotePayMoeny[$i]["promote_id"],$this->addid)) { - //存在 - $this->adddata[$promotePayMoeny[$i]["promote_id"]]["pay_money_count"] = $promotePayMoeny[$i]["pay_money_count"]; - }else{ - $this->addid[] = $promotePayMoeny[$i]["promote_id"]; - $this->adddata[$promotePayMoeny[$i]["promote_id"]] = $promotePayMoeny[$i]; - } - } - unset($promotePayMoeny); - } - //3聚合活跃 - public function promoteActive() - { - $map = ['login_time'=>['between',[$this->beginTime,$this->endTime]],"promote_id"=>["gt",0]];//0不是小号 - $promoteActive = $this->LoginModel->field('COUNT(DISTINCT user_id) AS active_user_count,GROUP_CONCAT(DISTINCT user_id) active_user_list,promote_id') - ->where($map) - ->group("promote_id") - ->select(); - $count = count($promoteActive); - for ($i=0; $i < $count; $i++) { - if (in_array($promoteActive[$i]["promote_id"],$this->addid)) { - //存在 - $this->adddata[$promoteActive[$i]["promote_id"]]["active_user_count"] = $promoteActive[$i]["active_user_count"]; - $this->adddata[$promoteActive[$i]["promote_id"]]["active_user_list"] = $promoteActive[$i]["active_user_list"]; - }else{ - $this->addid[] = $promoteActive[$i]["promote_id"]; - $this->adddata[$promoteActive[$i]["promote_id"]] = $promoteActive[$i]; - } - } - unset($promoteActive); - } - //4加入数据库 - public function promoteCreateDb() - { - $count = count($this->addid); - if ($count > 0) { - foreach ($this->adddata as $key => $value) { - $value['date']=$this->beginTime; - $value['create_time']=$this->nowdata; - $value['active_user_list'] = @json_encode(array_map("intFun",explode(",",$value['active_user_list']))); - if(empty($value['promote_account']) && $value['promote_id']){ - if($value['promote_id'] == 0){ - $value['promote_account'] = "官方渠道"; - }else{ - $value['promote_account'] = $this->PromoteModel->field("account")->where("id = {$value['promote_id']}")->find()['account']; - if(!$value['promote_account']){ - $value['promote_account']="未知推广员"; - } - } - } - $tempdbres = $this->PromoteCountModel->add($value); - if($tempdbres === false){ - $this->model->rollback(); - die("error"); - } - } - } - } - //=======================聚合游戏======================== - //1聚合新增 - public function gameNew() - { - $map = ['register_time'=>['between',[$this->beginTime,$this->endTime]],"puid"=>0,"fgame_id"=>["gt",0]];//0不是小号 - $gameNew = $this->UserModel->field('COUNT(1) AS new_user_count,fgame_id game_id,fgame_name game_name') - ->where($map) - ->group("fgame_id") - ->select(); - $count = count($gameNew); - for ($i=0; $i < $count; $i++) { - $this->gameid[] = $gameNew[$i]["game_id"]; - $this->gamedata[$gameNew[$i]["game_id"]] = $gameNew[$i]; - } - unset($gameNew); - } - //2聚合付费 - public function gamePayMoeny() - { - $map = ['pay_time'=>['between',[$this->beginTime,$this->endTime]],"pay_status"=>1,"game_id"=>["gt",0]];//1支付成功 - $gamePayMoeny = $this->SpendModel->field('sum(pay_amount) AS pay_money_count,game_id,game_name') - ->where($map) - ->group("game_id") - ->select(); - $count = count($gamePayMoeny); - for ($i=0; $i < $count; $i++) { - if (in_array($gamePayMoeny[$i]["game_id"],$this->gameid)) { - //存在 - $this->gamedata[$gamePayMoeny[$i]["game_id"]]["pay_money_count"] = $gamePayMoeny[$i]["pay_money_count"]; - }else{ - $this->gameid[] = $gamePayMoeny[$i]["game_id"]; - $this->gamedata[$gamePayMoeny[$i]["game_id"]] = $gamePayMoeny[$i]; - } - } - unset($gamePayMoeny); - } - //3聚合活跃 - public function gameActive() - { - $map = ['login_time'=>['between',[$this->beginTime,$this->endTime]],"game_id"=>["gt",0]];//0不是小号 - $gameActive = $this->LoginModel->field('COUNT(DISTINCT user_id) AS active_user_count,GROUP_CONCAT(DISTINCT user_id) active_user_list,game_id,game_name') - ->where($map) - ->group("game_id") - ->select(); - $count = count($gameActive); - for ($i=0; $i < $count; $i++) { - if (in_array($gameActive[$i]["game_id"],$this->gameid)) { - //存在 - $this->gamedata[$gameActive[$i]["game_id"]]["active_user_count"] = $gameActive[$i]["active_user_count"]; - $this->gamedata[$gameActive[$i]["game_id"]]["active_user_list"] = $gameActive[$i]["active_user_list"]; - }else{ - $this->gameid[] = $gameActive[$i]["game_id"]; - $this->gamedata[$gameActive[$i]["game_id"]] = $gameActive[$i]; - } - } - unset($gameActive); - } - //4加入数据库 - public function gameCreateDb() - { - $count = count($this->gameid); - if ($count > 0) { - foreach ($this->gamedata as $key => $value) { - $value['date']=$this->beginTime; - $value['create_time']=$this->nowdata; - $value['active_user_list'] = @json_encode(array_map("intFun",explode(",",$value['active_user_list']))); - $tempdbres = $this->GameCountModel->add($value); - if($tempdbres === false){ - $this->model->rollback(); - die("error"); - } - } - } - } } diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index ea6dd83b4..bced1d46d 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -28,64 +28,73 @@ class AggregateFinanceStatementController extends ThinkController $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']})"; + $time_start = strtotime($_REQUEST['time_start']); + $time_end = strtotime($_REQUEST['time_end'])+ 86399; + $map["_string"] = "(begintime BETWEEN {$time_start} AND {$time_end}) OR (endtime BETWEEN {$time_start} AND {$time_end})"; } elseif (isset($_REQUEST['time_start'])) { - $map["_string"] = "(begintime >= {$_REQUEST['time_start']} ) OR (endtime >= {$_REQUEST['time_end']})"; + $time_start = strtotime($_REQUEST['time_start']); + $map["_string"] = "(begintime >= {$time_start} ) OR (endtime >= {$time_start})"; } elseif (isset($_REQUEST['time_end'])) { - $map["_string"] = "(begintime <= {$_REQUEST['time_start']} ) OR (endtime <= {$_REQUEST['time_end']})"; + $time_end = strtotime($_REQUEST['time_end'])+ 86399; + $map["_string"] = "(begintime <= {$time_end} ) OR (endtime <= {$time_end})"; + } + + if (isset($_REQUEST['time_start2']) && isset($_REQUEST['time_end2'])) { + $map['create_time'] = ['between', [strtotime($_REQUEST['time_start2']), strtotime($_REQUEST['time_end2']) + 86399]]; + } elseif (isset($_REQUEST['time_start2'])) { + $map['create_time'] = ['EGT', strtotime($_REQUEST['time_start2'])]; + } elseif (isset($_REQUEST['time_end2'])) { + $map['create_time'] = ['ELT', strtotime($_REQUEST['time_end2']) + 86399]; } + 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']; + $typeflag = false; + if (isset($_REQUEST['withdraw_type'])) { + if($_REQUEST['withdraw_type'] == 1){ + $typeflag = 1;//月结 + $map["withdraw_type"] = 1; + }else{ + $typeflag = 2;//周结 + $map["withdraw_type"] = ["in",[0,2]]; + } + } + if (isset($_REQUEST['withdraw_type2'])) { + if($_REQUEST['withdraw_type2'] == 2){ + if($typeflag == 1){ //月结的补点找不到 + $map['withdraw_type'] = 999; + }else{ //周结的补点就是补点 + $map['withdraw_type'] = 2; + } + }else{ + if($typeflag == 1){//月结的正常=月结 + $map['withdraw_type'] = 1; + }elseif($typeflag == 2){//周结的正常=周结 + $map['withdraw_type'] = 0; + }else{//没选的正常是 非补点 + $map['withdraw_type'] = ["in",[0,1]]; + } + } } $data = M("aggregate_statement","tab_") ->where($map) - ->order("create_time Desc"); - if($is_export){ - $data = $data->select(); - }else{ - $data = $data->page($page,$row)->select(); - } + ->order("create_time Desc")->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']); + $data[$key]['withdraw_type_1'] = ($value['withdraw_type'] == 1 ? "月结" :"周结"); + $data[$key]['withdraw_type_2'] = ($value['withdraw_type'] == 2 ? "补点" :"正常结算"); } $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']; - // } - -// $sumData = M("statement","tab_") -// ->field('sum(`statement_money`) as sum_money,statement_type') -// ->where($map) -// ->group('statement_type') -// ->select(); - -// $handleSumData = []; -// foreach ($sumData as $key => $value) { - -// $handleSumData[$value['statement_type']] = $value['sum_money']; -// } -// if (!$handleSumData[1]) { -// $handleSumData[1] = 0; -// } - -// if (!$handleSumData[0]) { -// $handleSumData[0] = 0; -// } - - -// $this->assign('sum',$handleSumData); -// // dump($sumData);die(); //分页 $parameter['p'] = $page; @@ -107,8 +116,81 @@ class AggregateFinanceStatementController extends ThinkController public function getAggChannel() { return M("aggregate_statement","tab_")->field("channel_id,channel_name")->group("channel_id")->select(); - # code... } + //申请开票 + public function createStatement(){ + if (isset($_REQUEST['id'])){ + $id = $_REQUEST['id']; + }else{ + $this->error("参数错误"); + } + $info = M("aggregate_statement","tab_")->field("statement_info,pay_money,ratio_money")->where("id={$id}")->find(); + $statement_info = json_decode($info['statement_info'],true); + $this->assign('data',$statement_info); + $this->assign('data_count',["pay_money"=>$info['pay_money'],"ratio_money"=>$info['ratio_money']]); + $this->assign('id',$id); + $this->display(); + } + public function doAddStatement(){ + $first_partner_type = $_REQUEST['first_partner_type']; + $second_party_info = $_REQUEST['second_party_info']; + $statement_info = $_REQUEST['statement_info']; + $admininfo = $_SESSION['onethink_admin']['user_auth']; + $data_count = $_REQUEST['statement_count']; + //拼凑数据 + $adddata = array( + "pay_money"=>$data_count['pay_money'], + "ratio_money"=>$data_count['ratio_money'], + "pay_type"=>$_REQUEST['statement_type'] == 0 ? 1 :0, + "first_party_info"=>json_encode($_REQUEST['first_party_info'],JSON_UNESCAPED_UNICODE), + "second_party_info"=>json_encode($_REQUEST['second_party_info'],JSON_UNESCAPED_UNICODE), + "statement_info"=>json_encode($statement_info,JSON_UNESCAPED_UNICODE), + "admin_name"=>$admininfo['username'], + "admin_id"=>$admininfo['uid'], + "verify_status"=>1 + ); + $id = $_REQUEST['statement_id']; + $res = M("aggregate_statement","tab_")->where("id = '{$id}'")->save($adddata); + if($res !== false){ + $this->ajaxReturn(array("success"=>"ok","code"=>0)); + }else{ + $this->ajaxReturn(array("error"=>"database error","code"=>2000)); + } + } + + //获取公司信息 + public function getCompanyList() + { + $id = $_REQUEST['id']; + $cpCompany = M("aggregate_statement","tab_")->field("id,second_party_info")->where("id={$id}")->find(); + + $data = array(); + $data['ptCompany']= M("CompanyInfo","tab_")->field('id,partner')->select(); + $data['cpCompany']= [[ + "id"=> $cpCompany['id'], + "partner"=>json_decode($cpCompany['second_party_info'],true)['partner'] + ]]; + $this->ajaxReturn(array("success"=>$data,"code"=>2000)); + } + public function getCpCompanyInfo() + { + $CompanyId = $_REQUEST['company_id']; + $company_type = $_REQUEST['company_type']; + if($company_type == 'pt'){ + $info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find(); + }else{ + $cpCompany = M("aggregate_statement","tab_")->field("id,second_party_info")->where("id={$CompanyId}")->find(); + $info = json_decode($cpCompany['second_party_info'],true); + } + $info['invoice_item'] = "信息技术服务费"; + $info['invoice_type'] = "增值税专用发票"; + if(empty($info)){ + $this->ajaxReturn(array("error"=>"no find","code"=>2000)); + }else{ + $this->ajaxReturn(array("success"=>$info,"code"=>0)); + } + + } } diff --git a/Application/Admin/View/AggregateFinanceStatement/createStatement.html b/Application/Admin/View/AggregateFinanceStatement/createStatement.html new file mode 100644 index 000000000..c5e5d5df4 --- /dev/null +++ b/Application/Admin/View/AggregateFinanceStatement/createStatement.html @@ -0,0 +1,896 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
公司类型: +
+ +
+
甲方: +
+ +
+
联系人: + +
联系电话: + +
邮寄地址: + +
公司税号: + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
乙方: +
+ +
+
联系人: + +
联系电话: + +
邮寄地址: + +
公司税号: + +
+
+
+
+
+

支付给:

+
+
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
结算时间产品平台总额分成比例税费费率结算金额
+ 请先选择生成条件后点击生成对账数据 +
+
+
+
+
+ + + + + + + + + + + + + + + +
收款方名称: + +
银行账号: + +
开户行: + +
+
+
+ + + + + + + + + + + + + +
开票项目: + +
发票类型: + +
+
+
+
+ +
+ + + + + + + + diff --git a/Application/Admin/View/AggregateFinanceStatement/editStatement.html b/Application/Admin/View/AggregateFinanceStatement/editStatement.html new file mode 100644 index 000000000..c5e5d5df4 --- /dev/null +++ b/Application/Admin/View/AggregateFinanceStatement/editStatement.html @@ -0,0 +1,896 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
公司类型: +
+ +
+
甲方: +
+ +
+
联系人: + +
联系电话: + +
邮寄地址: + +
公司税号: + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
乙方: +
+ +
+
联系人: + +
联系电话: + +
邮寄地址: + +
公司税号: + +
+
+
+
+
+

支付给:

+
+
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
结算时间产品平台总额分成比例税费费率结算金额
+ 请先选择生成条件后点击生成对账数据 +
+
+
+
+
+ + + + + + + + + + + + + + + +
收款方名称: + +
银行账号: + +
开户行: + +
+
+
+ + + + + + + + + + + + + +
开票项目: + +
发票类型: + +
+
+
+
+ +
+ + + + + + + + diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index cc620bd31..1582edf36 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -57,29 +57,35 @@
+
+ +
+
-
- + + +
- +  - 
- +
@@ -93,6 +99,15 @@
+
+ +  -  +
+ + +
+
+ @@ -105,11 +120,19 @@ @@ -123,10 +146,11 @@ 对账公司 - 结算方式 - 对账日期 - 对账金额 - 状态 + 结算日期 + 结算周期 + 结算类型 + 结算金额 + 审批状态 操作人 生成时间 操作 @@ -146,18 +170,37 @@ {$data.channel_name} - 周结月结补点 {$data.begintime}-{$data.endtime} + {$data.withdraw_type_1} + {$data.withdraw_type_2} {$data.ratio_money} {$data.verify_status_str} {$data.admin_name} {$data.create_time} 查看 + + + + + + 申请开票 + + + 编辑 + + + + + + + + + @@ -278,46 +321,52 @@ }) //搜索功能 - var start = $("#time_start").val(); - var end = $("#time_end").val(); - if(start !='' && end != ''){ - if (Date.parse(start) > Date.parse(end)){ - layer.msg('开始时间必须小于等于结束时间'); - return false; - } - } - $("#upstream").click(function () { - layer.open({ - type: 2, - title: "海南万盟天下科技有限公司", - shadeClose: true, - shade: 0.8, - area: ['70%', '80%'], - content:'/admin.php?s=/Statement/createCpStatement/' - }); - }); - - $("#downstream").click(function () { + //申请开票 + $(".createStatement").click(function () { + var id = $(this).data("id"); layer.open({ type: 2, title: "海南万盟天下科技有限公司", shadeClose: true, shade: 0.8, area: ['70%', '80%'], - content: '/admin.php?s=/statementMangement/createDownstreamOrder/' + content:'/admin.php?s=/AggregateFinanceStatement/createStatement/id/'+id }); }); - - $("#persondownstream").click(function () { + //开票编辑 + $(".editStatement").click(function () { + var id = $(this).data("id"); layer.open({ type: 2, title: "海南万盟天下科技有限公司", shadeClose: true, shade: 0.8, area: ['70%', '80%'], - content: '/admin.php?s=/statementMangement/PersonOrderList/' + content:'/admin.php?s=/AggregateFinanceStatement/createStatement/id/'+id }); }); + + // $("#downstream").click(function () { + // layer.open({ + // type: 2, + // title: "海南万盟天下科技有限公司", + // shadeClose: true, + // shade: 0.8, + // area: ['70%', '80%'], + // content: '/admin.php?s=/statementMangement/createDownstreamOrder/' + // }); + // }); + + // $("#persondownstream").click(function () { + // layer.open({ + // type: 2, + // title: "海南万盟天下科技有限公司", + // shadeClose: true, + // shade: 0.8, + // area: ['70%', '80%'], + // content: '/admin.php?s=/statementMangement/PersonOrderList/' + // }); + // }); $(".statement_edit").click(function () { @@ -340,25 +389,25 @@ content: url }); }); - $(".statement_view").click(function () { - var id = $(this).data("id"); - - var type = $(this).data("type"); - if (type == 2) { - var url = "/admin.php?s=/StatementMangement/personOrderDetail/id/"+id; - } else { - var url = "/admin.php?s=/VerifyBill/show/id/"+id+"/from/pc"; - } - - layer.open({ - type: 2, - title: "海南万盟天下科技有限公司", - shadeClose: true, - shade: 0.8, - area: ['70%', '80%'], - content: url - }); - }); + // $(".statement_view").click(function () { + // var id = $(this).data("id"); + + // var type = $(this).data("type"); + // if (type == 2) { + // var url = "/admin.php?s=/StatementMangement/personOrderDetail/id/"+id; + // } else { + // var url = "/admin.php?s=/VerifyBill/show/id/"+id+"/from/pc"; + // } + + // layer.open({ + // type: 2, + // title: "海南万盟天下科技有限公司", + // shadeClose: true, + // shade: 0.8, + // area: ['70%', '80%'], + // content: url + // }); + // }); $(".statement_del").click(function () { var del = $(this).data(); layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', { @@ -435,25 +484,21 @@ pickerPosition: 'bottom-left' }) + $('#time_start2').datetimepicker({ + format: 'yyyy-mm-dd', + language: "zh-CN", + minView: 2, + autoclose: true + }); - $("#company_id").change(function(){ - - var str = ''; - console.log($("#company_id option:selected").attr('company-type')) - if ($("#company_id option:selected").attr('company-type') == '1') { - str += ' \n' + - ' '; - } else if ($("#company_id option:selected").attr('company-type') == '0') { - str += ' \n' + - ' '; - } - - - $("#statement_type").empty(); - $("#statement_type").append(str); - $("#statement_type").select2(); + $('#datetimepicker2').datetimepicker({ + format: 'yyyy-mm-dd', + language: "zh-CN", + minView: 2, + autoclose: true, + pickerPosition: 'bottom-left' + }) - }); $(".paixu").click(function(){ From 422728ed11d1d82a77e0e905afcd090d60798a92 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 24 Apr 2020 09:58:39 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 51 +++- .../createStatement.html | 4 +- .../editStatement.html | 239 ++++++++---------- .../View/AggregateFinanceStatement/lists.html | 12 +- 4 files changed, 165 insertions(+), 141 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index bced1d46d..a6d58e48b 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -89,8 +89,8 @@ class AggregateFinanceStatementController extends ThinkController 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']); + $data[$key]['begintime'] = date('Y-m-d',$value['begintime']); + $data[$key]['endtime'] = date('Y-m-d',$value['endtime']); $data[$key]['withdraw_type_1'] = ($value['withdraw_type'] == 1 ? "月结" :"周结"); $data[$key]['withdraw_type_2'] = ($value['withdraw_type'] == 2 ? "补点" :"正常结算"); } @@ -103,8 +103,6 @@ class AggregateFinanceStatementController extends ThinkController if ($page) { $this->assign('_page', $page); } - -// $this->meta_title = '结算单管理'; $this->assign('data',$data); $this->assign('total',$count['ratio_money']); $this->assign('channel',$this->getAggChannel()); @@ -137,6 +135,10 @@ class AggregateFinanceStatementController extends ThinkController $statement_info = $_REQUEST['statement_info']; $admininfo = $_SESSION['onethink_admin']['user_auth']; $data_count = $_REQUEST['statement_count']; + if(!isset($_REQUEST['statement_id'])){ + $this->error("参数错误"); + } + //拼凑数据 $adddata = array( "pay_money"=>$data_count['pay_money'], @@ -147,7 +149,8 @@ class AggregateFinanceStatementController extends ThinkController "statement_info"=>json_encode($statement_info,JSON_UNESCAPED_UNICODE), "admin_name"=>$admininfo['username'], "admin_id"=>$admininfo['uid'], - "verify_status"=>1 + "verify_status"=>1, + "create_time"=>time() ); $id = $_REQUEST['statement_id']; $res = M("aggregate_statement","tab_")->where("id = '{$id}'")->save($adddata); @@ -191,6 +194,44 @@ class AggregateFinanceStatementController extends ThinkController } } + public function editStatement(){ + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $dbres = M("aggregate_statement","tab_")->where("id = '{$id}'")->find(); + $first_party_info = json_decode($dbres['first_party_info'],true); + $second_party_info = json_decode($dbres['second_party_info'],true); + $statement_info = json_decode($dbres['statement_info'],true); + + // if($dbres['company_name'] == $first_party_info['partner']){ + // $first_partner_type=0; + // }else{ + // $first_partner_type=1; + // } + // $fine = array_pop($statement_info); + $senddata = array( + // "first_partner_type"=>1, + "statement_id"=>$dbres['id'], + "first_part_company"=>$first_party_info['partner'], + "second_part_company"=>$second_party_info['partner'], + "statement_type"=>$dbres['pay_type'] == 0 ? 1 :0, + "first_party_info"=>$first_party_info, + "second_party_info"=>$second_party_info, + "statement_info"=>$statement_info, + "statement_count"=>array("pay_money"=>$dbres['pay_money'],"ratio_money"=>$dbres['ratio_money']) + ); + + $this->assign("data",$senddata); + if($dbres['pay_type'] == 0){ + $this->assign("company",$second_party_info['partner']); + }else{ + $this->assign("company",$first_party_info['partner']); + } + $this->assign("company_id",$dbres['company_id']); + $this->assign("company_name",$dbres['company_name']); + $this->assign("id",$dbres['id']); + $this->display(); + +} } diff --git a/Application/Admin/View/AggregateFinanceStatement/createStatement.html b/Application/Admin/View/AggregateFinanceStatement/createStatement.html index c5e5d5df4..15b16ea59 100644 --- a/Application/Admin/View/AggregateFinanceStatement/createStatement.html +++ b/Application/Admin/View/AggregateFinanceStatement/createStatement.html @@ -90,12 +90,12 @@ - + - @@ -182,6 +170,11 @@ 上传凭证查看凭证编辑凭证 + 新增备注 + 修改备注 + 查看备注 + + @@ -234,6 +227,7 @@ + - diff --git a/Data/update.sql b/Data/update.sql index add5e181e..5a36ceed2 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1639,6 +1639,7 @@ CREATE TABLE `tab_aggregate_statement` ( `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已到账', + `remark` longtext DEFAULT NULL COMMENT '备注信息', PRIMARY KEY (`id`), KEY `withdraw_type` (`withdraw_type`) USING BTREE, KEY `channel_id` (`channel_id`) USING BTREE, From 253b47b2a99c57c11f3ee61e5cae102f91555910 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sun, 26 Apr 2020 09:14:26 +0800 Subject: [PATCH 14/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E5=AD=90=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateFinanceSetController.class.php | 2 +- ...regateFinanceStatementController.class.php | 55 ++++++- .../View/AggregateFinanceStatement/lists.html | 148 +++++++++++++++++- 3 files changed, 198 insertions(+), 7 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceSetController.class.php b/Application/Admin/Controller/AggregateFinanceSetController.class.php index ce92f5dd1..2b6bb592f 100644 --- a/Application/Admin/Controller/AggregateFinanceSetController.class.php +++ b/Application/Admin/Controller/AggregateFinanceSetController.class.php @@ -109,7 +109,6 @@ class AggregateFinanceSetController extends Controller { $dataurl .= $this->apihost."&".http_build_query($arr); $html = file_get_contents($dataurl); $rsp = json_decode($html,true); - var_dump($dataurl); if($rsp['code'] != 1){ echo $rsp['error'].PHP_EOL;die; } @@ -147,6 +146,7 @@ class AggregateFinanceSetController extends Controller { echo "----补点统计ok".PHP_EOL; } } + diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 144089765..60583a02b 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -13,9 +13,15 @@ class AggregateFinanceStatementController extends ThinkController "1"=>"申请开票", "2"=>"审核同意", "3"=>"已开票", - "4"=>"上传收款凭证", + "4"=>"已上传凭证", "5"=>"已到账" ]; + public $admininfo; + public function _initialize() + { + $this->admininfo = $_SESSION['onethink_admin']['user_auth']; + parent::_initialize(); + } public function lists() { $is_export= false; if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ @@ -311,6 +317,8 @@ class AggregateFinanceStatementController extends ThinkController if($info["verify_status"] == 3){ $save['verify_status'] = 4; $save['create_time'] = time(); + $save["admin_name"]=$this->admininfo["username"]; + $save["admin_id"]=$this->admininfo["uid"]; } M("aggregate_statement","tab_")->where("id = '{$id}'")->save($save); $array=array( @@ -346,7 +354,50 @@ class AggregateFinanceStatementController extends ThinkController 'info' => "操作成功" )); } - + //审批通过 + public function agreeApply(){ + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + $savedata = ["verify_status"=>2,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]]; + M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"审批通过成功" + )); + } + //审核拒绝 + public function refuseApply(){ + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + $savedata = ["verify_status"=>-1,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]]; + M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"审批拒绝成功" + )); + } + //已开票 + public function Invoiced(){ + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + $savedata = ["verify_status"=>3,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]]; + M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"已开票成功" + )); + } + //已到账 + public function Received(){ + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + $savedata = ["verify_status"=>5,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]]; + M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"已到账成功" + )); + } //导出 public function export() { diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index bf2813157..e3f985e12 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -115,9 +115,9 @@
审批通过 审批拒绝 + 已开票 + 已到账 - 已开票 - 已到账 重算对账金额 批量导出 @@ -264,6 +264,7 @@ $("body").append(iframeExcel) } }) + //审批通过 $("#agreeApply").on("click",function(){ var flag = false; var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { @@ -278,7 +279,7 @@ return; } if(flag){ - layer.confirm("审批成功仅会对 已申请发票结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){ + layer.confirm("审批成功仅会对 [已申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){ _doAgreeApply(); layer.close(index); }); @@ -287,7 +288,144 @@ } function _doAgreeApply(){ //执行 - + $.ajax({ + type: "POST", + url: "{:U('agreeApply')}", + dataType: 'json', + async: false, + data: {ids:text}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); + } + }) + //审批拒绝 + $("#refuseApply").on("click",function(){ + var flag = false; + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + if($(elem).data("status") != 1){ + flag = true; + }else{ + return $(elem).val(); + } + }).get().join(","); + if(text == ''){ + layer.msg("" + '无需要审核拒绝的结算单' + ""); + return; + } + if(flag){ + layer.confirm("审批拒绝仅会对 [已申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){ + _doRefuseApply(); + layer.close(index); + }); + }else{ + _doRefuseApply(); + } + function _doRefuseApply(){ + //执行 + $.ajax({ + type: "POST", + url: "{:U('refuseApply')}", + dataType: 'json', + async: false, + data: {ids:text}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); + } + }) + //已开票 + $("#Invoiced").on("click",function(){ + var flag = false; + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + if($(elem).data("status") != 2){ + flag = true; + }else{ + return $(elem).val(); + } + }).get().join(","); + if(text == ''){ + layer.msg("" + '无需要进行已开票的结算单' + ""); + return; + } + if(flag){ + layer.confirm("已开票仅会对 [审核同意] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){ + _doInvoiced(); + layer.close(index); + }); + }else{ + _doInvoiced(); + } + function _doInvoiced(){ + //执行 + $.ajax({ + type: "POST", + url: "{:U('Invoiced')}", + dataType: 'json', + async: false, + data: {ids:text}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); + } + }) + //已到账 + $("#Received").on("click",function(){ + var flag = false; + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + if($(elem).data("status") == 3 || $(elem).data("status") == 4){ + return $(elem).val(); + }else{ + flag = true; + } + }).get().join(","); + if(text == ''){ + layer.msg("" + '无需要进行已到账的结算单' + ""); + return; + } + if(flag){ + layer.confirm("已到账仅会对 [已开票]或[已上传凭证] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){ + _doReceived(); + layer.close(index); + }); + }else{ + _doReceived(); + } + function _doReceived(){ + //执行 + $.ajax({ + type: "POST", + url: "{:U('Received')}", + dataType: 'json', + async: false, + data: {ids:text}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); } }) @@ -509,6 +647,8 @@ }); }); + + $(".statement_del").click(function () { var del = $(this).data(); layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', { From 16d9813e18edba0ed9cdd1d4a273150c35f02a88 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sun, 26 Apr 2020 11:24:33 +0800 Subject: [PATCH 15/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E9=87=8D=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateFinanceSetController.class.php | 59 +++++++++++++++++++ ...regateFinanceStatementController.class.php | 21 +++++++ .../View/AggregateFinanceStatement/lists.html | 36 ++++++++++- 3 files changed, 114 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceSetController.class.php b/Application/Admin/Controller/AggregateFinanceSetController.class.php index 2b6bb592f..d6db14fbf 100644 --- a/Application/Admin/Controller/AggregateFinanceSetController.class.php +++ b/Application/Admin/Controller/AggregateFinanceSetController.class.php @@ -146,6 +146,65 @@ class AggregateFinanceSetController extends Controller { echo "----补点统计ok".PHP_EOL; } } + public function updateAggregateFinanceData($id) + { + //获取基础信息 + $Aggregate = M("aggregate_statement","tab_"); + $info = $Aggregate->where("id='{$id}'")->find(); + $sign = md5($info['begintime'].$info['endtime'].$info['withdraw_type'].$this->token); + $arr = [ + "begintime"=>$info['begintime'], + "endtime"=>$info['endtime'], + "type"=>$info['withdraw_type'], + "sign"=>$sign, + "channel_id"=>$info['channel_id'] + ]; + $dataurl .= $this->apihost."&".http_build_query($arr); + $html = file_get_contents($dataurl); + $rsp = json_decode($html,true); + if($rsp['code'] != 1){ + echo $rsp['error'].PHP_EOL;die; + } + //更新信息 + $begintimestr = date("Y-m-d",$info['begintime']); + $endtimestr = date("Y-m-d",$info['endtime']); + var_dump($rsp); + if($rsp['count'] > 0){ + //插入数据 + foreach ($rsp['data'] as $k => $v) { + foreach ($v["game_list"] as $ke => &$va) { + $va['begintime'] = $begintimestr; + $va['endtime'] = $endtimestr; + $va['fax_ratio'] = 0; + } + $v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE); + unset($v["game_list"]); + $v['create_time'] = time(); + $v['admin_name'] = $_SESSION['onethink_admin']['user_auth']['username']; + $v['admin_id'] = $_SESSION['onethink_admin']['user_auth']['uid']; + $v['verify_status'] = 0; + $res = $Aggregate->where("id='{$id}'")->save($v); + if(empty($res)){ + return false; + } + } + }else{ + $savedata = [ + "create_time"=>time(), + "admin_name"=>$_SESSION['onethink_admin']['user_auth']['username'], + "admin_id"=>$_SESSION['onethink_admin']['user_auth']['uid'], + "verify_status"=>0, + "statement_info"=>json_encode([],JSON_UNESCAPED_UNICODE), + "ratio_money"=>0, + "pay_money"=>0 + ]; + $res = $Aggregate->where("id='{$id}'")->save($savedata); + if(empty($res)){ + return false; + } + } + return true; + } diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 60583a02b..09be5a7f3 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -398,6 +398,27 @@ class AggregateFinanceStatementController extends ThinkController "info"=>"已到账成功" )); } + //重算金额 + public function updateStatement() + { + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = explode(",",$_REQUEST['ids']); + foreach ($ids as $k => $v) { + $res = A("AggregateFinanceSet")->updateAggregateFinanceData($v); + var_dump($res); + if(!$res){ + $this->ajaxReturn(array( + 'status' => 0, + "info"=>"重算结算金额失败" + )); + } + } + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"算结算金额成功" + )); + + } //导出 public function export() { diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index e3f985e12..a2a11c5b0 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -117,8 +117,7 @@ 审批拒绝 已开票 已到账 - - 重算对账金额 + 重算结算金额 批量导出
@@ -428,6 +427,39 @@ }); } }) + //重算金额 + $("#updateStatement").on("click",function(){ + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + return $(elem).val(); + }).get().join(","); + if(text == ''){ + layer.msg("" + '无需要进行重新结算的结算单' + ""); + return; + } + layer.confirm("重算结算金额会对结算单回退到未申请发票状态,请慎重处理,点击取消停止操作",{title:false}, function(index){ + _doReceived(); + layer.close(index); + }); + function _doReceived(){ + //执行 + $.ajax({ + type: "POST", + url: "{:U('updateStatement')}", + dataType: 'json', + async: false, + data: {ids:text}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); + } + }) + $("#shenhe").click(function () { var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { From fe662ce160b1fa2056602cf355c2590d72e85e55 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sun, 26 Apr 2020 11:49:35 +0800 Subject: [PATCH 16/20] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=AD=90=E6=93=8D?= =?UTF-8?q?=E4=BD=9Cok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 22 ++++++++ .../View/AggregateFinanceStatement/lists.html | 50 ++++++++++++++++++- 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 09be5a7f3..f8f519ece 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -419,6 +419,28 @@ class AggregateFinanceStatementController extends ThinkController )); } + //撤销审核 + public function cancelVerify(){ + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $savedata = ["verify_status"=>1,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]]; + M("aggregate_statement","tab_")->where("id ='{$id}'")->save($savedata); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"撤销审核成功" + )); + } + //撤销申请 + public function cancelApply(){ + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $savedata = ["verify_status"=>0,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]]; + M("aggregate_statement","tab_")->where("id ='{$id}'")->save($savedata); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"撤销申请成功" + )); + } //导出 public function export() { diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index a2a11c5b0..518c86a67 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -173,6 +173,9 @@ 修改备注 查看备注 + 撤销审核 + 撤销申请 + @@ -678,8 +681,51 @@ content:"
"+remark+"
" }); }); - - + //撤销审核 + $(".cancelVerify").click(function(){ + var id = $(this).data("id"); + layer.confirm("撤销审核将回退到[已申请开票]状态,点击取消停止操作",{title:false}, function(index){ + $.ajax({ + type: "POST", + url: "{:U('cancelVerify')}", + dataType: 'json', + async: false, + data: {id:id}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); + // layer.close(index); + }); + }) + //撤销申请 + $(".cancelApply").click(function(){ + var id = $(this).data("id"); + layer.confirm("撤销申请将回退到[未申请开票]状态,点击取消停止操作",{title:false}, function(index){ + $.ajax({ + type: "POST", + url: "{:U('cancelApply')}", + dataType: 'json', + async: false, + data: {id:id}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); + // layer.close(index); + }); + }) + $(".statement_del").click(function () { var del = $(this).data(); From 2a28cf900861eaf3226ede75286afc50e5556349 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Sun, 26 Apr 2020 15:58:42 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 133 +++++++++++++++++- .../View/AggregateFinanceStatement/lists.html | 55 ++------ 2 files changed, 145 insertions(+), 43 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index f8f519ece..c3918e0bb 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -17,17 +17,25 @@ class AggregateFinanceStatementController extends ThinkController "5"=>"已到账" ]; public $admininfo; + public $OpAuthList=[]; + //TODO: public function _initialize() { $this->admininfo = $_SESSION['onethink_admin']['user_auth']; parent::_initialize(); } + public function lists() { $is_export= false; if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ $is_export = true; } - + //权限 + if(!IS_ROOT){ + $this->getAuth(); + } + + //分页 $page = intval(I('get.p', 0)); $page = $page ? $page : 1; //默认显示第一页数据 $row = intval(I('row', 0)); @@ -99,6 +107,8 @@ class AggregateFinanceStatementController extends ThinkController $data[$key]['endtime'] = date('Y-m-d',$value['endtime']); $data[$key]['withdraw_type_1'] = ($value['withdraw_type'] == 1 ? "月结" :"周结"); $data[$key]['withdraw_type_2'] = ($value['withdraw_type'] == 2 ? "补点" :"正常结算"); + + $data[$key]['oplist'] = $this->OpAuth($value); } $count = M("aggregate_statement","tab_")->field("count(id) count,SUM(ratio_money) ratio_money")->where($map)->find(); @@ -109,6 +119,8 @@ class AggregateFinanceStatementController extends ThinkController if ($page) { $this->assign('_page', $page); } + // + $this->assign('menubtn',$this->menuAuth()); $this->assign('data',$data); $this->assign('total',$count['ratio_money']); $this->assign('channel',$this->getAggChannel()); @@ -434,7 +446,14 @@ class AggregateFinanceStatementController extends ThinkController public function cancelApply(){ if(!isset($_REQUEST['id'])) $this->error("参数错误"); $id = $_REQUEST['id']; + $data = M("aggregate_statement","tab_")->where("id = '{$id}'")->find(); $savedata = ["verify_status"=>0,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]]; + $first_party_info = json_decode($data['first_party_info'], 1); + if($first_party_info['partner'] == $data['channel_name']){ + $savedata['second_party_info'] = $data['first_party_info']; + $savedata['first_party_info'] = $data['second_party_info']; + $savedata['pay_type'] =0; + } M("aggregate_statement","tab_")->where("id ='{$id}'")->save($savedata); $this->ajaxReturn(array( 'status' => 1, @@ -531,6 +550,118 @@ class AggregateFinanceStatementController extends ThinkController $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); } + //获取权限 + public function getAuth() + { + $group = $_SESSION['onethink_admin']['user_group_id']; + //获取全部权限列表 + $ruleList = M("AuthGroup")->field("rules")->where("id='{$group}'")->find()['rules']; + //获取所有含有规则的数据 + $authlist = M("AuthRule")->field('name')->where("name like 'Admin/AggregateFinanceStatement%' AND id in ($ruleList)")->select(); + $Auth = []; + foreach ($authlist as $k => $v) { + $a = str_replace("Admin/AggregateFinanceStatement/","",$v['name']); + $Auth[] = $a; + } + $this->OpAuthList = $Auth; + } + public function OpAuth($info) + { + $id = $info['id']; + $img = $info['ext_field']; + $remark = $info['remark']; + //原始列表 + $opBtn = [ + "viewStatement"=>"查看", + "createStatement"=>"申请开票", + "editStatement"=>"编辑", + "uploadVoucher"=>"上传凭证", + "viewVoucher"=>"查看凭证", + "editVoucher"=>" 编辑凭证", + "addRemark"=>"新增备注", + "editRemark"=>"修改备注", + "viewRemark"=>"查看备注", + "cancelVerify"=>"撤销审核", + "cancelApply"=>"撤销申请", + ]; + //操作对应菜单 + $optist = []; + switch ($info['verify_status']) { + case '-1': + $optist = ["viewStatement","cancelVerify","addRemark","editRemark","viewRemark"]; + break; + case '0': + $optist = ["viewStatement","createStatement"]; + break; + case '1': + $optist = ["viewStatement","editStatement","cancelApply"]; + break; + case '2': + $optist = ["viewStatement","cancelVerify","addRemark","editRemark","viewRemark"]; + break; + case '3': + $optist = ["viewStatement","uploadVoucher","addRemark","editRemark","viewRemark"]; + break; + case '4': + $optist = ["viewStatement","viewVoucher","editVoucher","addRemark","editRemark","viewRemark"]; + break; + case '5': + $optist = ["viewStatement","uploadVoucher","viewVoucher","editVoucher","addRemark","editRemark","viewRemark"]; + break; + default: + break; + } + //判断凭证和备注 + if(empty($info['ext_field'])){ + //未上传凭证 + if($optist['viewVoucher']) unset($optist['viewVoucher']); + if($optist['editVoucher']) unset($optist['editVoucher']); + }else{ + if($optist['uploadVoucher']) unset($optist['uploadVoucher']); + } + if(empty($info['remark'])){ + //未上传备注 + if($optist['editRemark']) unset($optist['editRemark']); + if($optist['viewRemark']) unset($optist['viewRemark']); + }else{ + if($optist['addRemark']) unset($optist['addRemark']); + } + // + $resarr = []; + foreach ($optist as $k => $v) { + if(IS_ROOT){ + $resarr[] = $opBtn[$v]; + }else{ + if(in_array($v,$this->OpAuthList)){ + $resarr[] = $opBtn[$v]; + } + } + } + return $resarr; + } + public function menuAuth() + { + $optist = ['agreeApply',"refuseApply","Invoiced","Received","updateStatement","export"]; + $mentBtn = [ + "agreeApply"=>"审批通过", + "refuseApply"=>"审批拒绝", + "Invoiced"=>"已开票", + "Received"=>"已到账", + "updateStatement"=>"重算结算金额", + "export"=>"批量导出" + ]; + $resarr = []; + foreach ($optist as $k => $v) { + if(IS_ROOT){ + $resarr[] = $mentBtn[$v]; + }else{ + if(in_array($v,$this->OpAuthList)){ + $resarr[] = $mentBtn[$v]; + } + } + } + return $resarr; + } } diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index 518c86a67..302016bf2 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -113,13 +113,15 @@ @@ -165,40 +167,9 @@
@@ -240,7 +211,7 @@
公司类型:甲方类型:
diff --git a/Application/Admin/View/AggregateFinanceStatement/editStatement.html b/Application/Admin/View/AggregateFinanceStatement/editStatement.html index c5e5d5df4..319ccda07 100644 --- a/Application/Admin/View/AggregateFinanceStatement/editStatement.html +++ b/Application/Admin/View/AggregateFinanceStatement/editStatement.html @@ -89,25 +89,13 @@
- - - - @@ -143,17 +131,13 @@
公司类型: -
- -
-
甲方:
+ +
- - - - @@ -189,13 +173,15 @@
-

支付给:

+

支付给:{$company} + +

-
+
@@ -247,6 +247,22 @@ } $(function(){ + $("#export").click(function () { + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + return $(elem).val(); + }).get(); + if(text.length > 2){ + layer.msg("" + '暂不支持超过20条的批量导出' + ""); + return; + } + if(text.length < 1){ + layer.msg("" + '请先选择要导出的结算单' + ""); + return; + } + text = text.join(","); + window.location.href = "{:U('export')}"+"&ids="+text; + + }) $("#shenhe").click(function () { var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { @@ -320,13 +336,25 @@ }) - //搜索功能 + //查看开票信息 + + $(".viewStatement").click(function () { + var id = $(this).data("id"); + layer.open({ + type: 2, + title: "查看开票信息", + shadeClose: true, + shade: 0.8, + area: ['70%', '80%'], + content:'/admin.php?s=/AggregateFinanceStatement/viewStatement/id/'+id + }); + }); //申请开票 $(".createStatement").click(function () { var id = $(this).data("id"); layer.open({ type: 2, - title: "海南万盟天下科技有限公司", + title: "申请开票", shadeClose: true, shade: 0.8, area: ['70%', '80%'], @@ -338,7 +366,7 @@ var id = $(this).data("id"); layer.open({ type: 2, - title: "海南万盟天下科技有限公司", + title: "开票编辑", shadeClose: true, shade: 0.8, area: ['70%', '80%'], diff --git a/Application/Admin/View/AggregateFinanceStatement/viewStatement.html b/Application/Admin/View/AggregateFinanceStatement/viewStatement.html new file mode 100644 index 000000000..9d7bf0bb3 --- /dev/null +++ b/Application/Admin/View/AggregateFinanceStatement/viewStatement.html @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
乙方:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
甲方: +
+ +
+
联系人: + +
联系电话: + +
邮寄地址: + +
公司税号: + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
乙方: +
+ +
+
联系人: + +
联系电话: + +
邮寄地址: + +
公司税号: + +
+
+
+ + +
+
+

支付给:{$data.company} + +

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
结算时间产品平台总额分成比例税费费率结算金额
{$it.begintime}~{$it.endtime}{$it.game_name}{$it.money}元%%{$it.ratio_money}元
合计{$data.statement_count.pay_money}元{$data.statement_count.ratio_money}元
本月分成总金额(人民币大写):{$data.statement_count.big_ratio_money}
+
+
+ +
+
+ + + + + + + + + + + + + + + +
收款方名称: + +
银行账号: + +
开户行: + +
+
+
+ + + + + + + + + + + +
开票项目: + +
发票类型: + +
+
+
+
+ + From ce4c9380801372f6b510acac3be453b5951c1bcd Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 24 Apr 2020 15:09:39 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=81=9A=E5=90=88?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 28 +++++++++---------- .../View/AggregateFinanceStatement/lists.html | 10 +++++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index cce8f5e11..d503e4f18 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -262,23 +262,25 @@ class AggregateFinanceStatementController extends ThinkController $this->display(); } //导出 - public function export(){ - if(!isset($_REQUEST['ids'])) $this->error("参数错误"); - $ids = explode(",",$_REQUEST['ids']); - foreach ($ids as $k => $v) { - $this->doexport($v); - } - } - private function doexport($id) + // public function export(){ + // if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + // $ids = explode(",",$_REQUEST['ids']); + // foreach ($ids as $k => $v) { + // $this->doexport($v); + // } + // } + public function export() { + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $data = M("aggregate_statement","tab_")->where("id = '{$id}'")->find(); $data['first_party_info'] = json_decode($data['first_party_info'], 1);//甲方 $data['second_party_info'] = json_decode($data['second_party_info'], 1);//乙方 $data['statement_info'] = json_decode($data['statement_info'], 1);//结算记录 //收款方 - $big_pay_money = convertAmountToCn($data['pay_money']);//大写 - + $big_pay_money = convertAmountToCn($data['ratio_money']);//大写 $data['receive_company'] = $data['pay_type'] ? $data['first_party_info'] : $data['second_party_info']; $data['pay_company'] = $data['pay_type'] ? $data['second_party_info'] : $data['first_party_info']; $this->excelDownStreamTemplate($data,$big_pay_money); @@ -353,16 +355,12 @@ class AggregateFinanceStatementController extends ThinkController }else{ $fileName = "{$data['second_party_info']['partner']}&{$data['first_party_info']['partner']}-对账单{$statement_begin_time}-{$statement_end_time}"; } - - // dd($fileName); ob_end_clean();//清除缓冲区,避免乱码 header('pragma:public'); header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $fileName .'".xls'); header("Content-Disposition:attachment;filename={$fileName}.xls");//attachment新窗口打印inline本窗口打印 $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); - $objWriter->save('php://output'); - exit; - + $objWriter->save('php://output'); } diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index cbdf3cf55..72b77d20a 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -251,6 +251,7 @@ var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { return $(elem).val(); }).get(); + if(text.length > 2){ layer.msg("" + '暂不支持超过20条的批量导出' + ""); return; @@ -259,9 +260,12 @@ layer.msg("" + '请先选择要导出的结算单' + ""); return; } - text = text.join(","); - window.location.href = "{:U('export')}"+"&ids="+text; - + for (var index = 0; index < text.length; index++) { + var id = text[index]; + var url ="{:U('export')}"+"&id="+id; + var iframeExcel = ""//添加下载的地址到iframe,这里是公司信息,我用**表示了。 + $("body").append(iframeExcel) + } }) $("#shenhe").click(function () { From 2fc38b25b6f1f7cd4a2865c96656a38c70858379 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 24 Apr 2020 15:23:11 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E8=81=9A=E5=90=88=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=95=E5=AF=BC=E5=87=BA=E4=BC=98=E5=8C=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 19 +++++++++--------- Public/Admin/excel/aggregate_stream.xls | Bin 0 -> 26624 bytes 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 Public/Admin/excel/aggregate_stream.xls diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index d503e4f18..8d2b9d0e8 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -262,13 +262,6 @@ class AggregateFinanceStatementController extends ThinkController $this->display(); } //导出 - // public function export(){ - // if(!isset($_REQUEST['ids'])) $this->error("参数错误"); - // $ids = explode(",",$_REQUEST['ids']); - // foreach ($ids as $k => $v) { - // $this->doexport($v); - // } - // } public function export() { if(!isset($_REQUEST['id'])) $this->error("参数错误"); @@ -300,12 +293,12 @@ class AggregateFinanceStatementController extends ThinkController $objReader = \PHPExcel_IOFactory::createReader('Excel5'); //设置模板文件 - $objPHPExcel = $objReader->load("Public/Admin/excel/down_stream.xls"); + $objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls"); $statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间 $statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间 $objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['channel_name']} 》结算单 - ({$statement_begin_time}-{$statement_end_time}"); + ({$statement_begin_time}-{$statement_end_time})"); if ($data['withdraw_type'] == '2') { $objPHPExcel->getActiveSheet()->setCellValue('D2','补点比例'); @@ -322,9 +315,15 @@ class AggregateFinanceStatementController extends ThinkController $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['money']); - $objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name); $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['ratio_money']); + + $objPHPExcel->getActiveSheet()->getStyle('A'.$line)->getFont()->setBold(false); + $objPHPExcel->getActiveSheet()->getStyle('B'.$line)->getFont()->setBold(false); + $objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getFont()->setBold(false); + $objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getFont()->setBold(false); + $objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getFont()->setBold(false); + $objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getFont()->setBold(false); $line++; } diff --git a/Public/Admin/excel/aggregate_stream.xls b/Public/Admin/excel/aggregate_stream.x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81=9A=E5=90=88=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=95=E5=AF=BC=E5=87=BA=E4=BC=98=E5=8C=963?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 50 ++++++++----------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 8d2b9d0e8..9c8c954ae 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -174,27 +174,27 @@ class AggregateFinanceStatementController extends ThinkController "partner"=>json_decode($cpCompany['second_party_info'],true)['partner'] ]]; $this->ajaxReturn(array("success"=>$data,"code"=>2000)); - } - public function getCpCompanyInfo() - { - $CompanyId = $_REQUEST['company_id']; - $company_type = $_REQUEST['company_type']; - if($company_type == 'pt'){ - $info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find(); - }else{ - $cpCompany = M("aggregate_statement","tab_")->field("id,second_party_info")->where("id={$CompanyId}")->find(); - $info = json_decode($cpCompany['second_party_info'],true); - } - $info['invoice_item'] = "信息技术服务费"; - $info['invoice_type'] = "增值税专用发票"; - if(empty($info)){ - $this->ajaxReturn(array("error"=>"no find","code"=>2000)); - }else{ - $this->ajaxReturn(array("success"=>$info,"code"=>0)); - } + } + public function getCpCompanyInfo() + { + $CompanyId = $_REQUEST['company_id']; + $company_type = $_REQUEST['company_type']; + if($company_type == 'pt'){ + $info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find(); + }else{ + $cpCompany = M("aggregate_statement","tab_")->field("id,second_party_info")->where("id={$CompanyId}")->find(); + $info = json_decode($cpCompany['second_party_info'],true); + } + $info['invoice_item'] = "信息技术服务费"; + $info['invoice_type'] = "增值税专用发票"; + if(empty($info)){ + $this->ajaxReturn(array("error"=>"no find","code"=>2000)); + }else{ + $this->ajaxReturn(array("success"=>$info,"code"=>0)); + } - } - public function editStatement(){ + } + public function editStatement(){ if(!isset($_REQUEST['id'])) $this->error("参数错误"); $id = $_REQUEST['id']; $dbres = M("aggregate_statement","tab_")->where("id = '{$id}'")->find(); @@ -291,10 +291,8 @@ class AggregateFinanceStatementController extends ThinkController Vendor("PHPExcel.PHPExcel"); $objPHPExcel = new \PHPExcel(); $objReader = \PHPExcel_IOFactory::createReader('Excel5'); - //设置模板文件 $objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls"); - $statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间 $statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间 $objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['channel_name']} 》结算单 @@ -303,13 +301,10 @@ class AggregateFinanceStatementController extends ThinkController if ($data['withdraw_type'] == '2') { $objPHPExcel->getActiveSheet()->setCellValue('D2','补点比例'); } - $line = 3; - foreach ($data['statement_info'] as $key => $value) { $objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1); $objPHPExcel->getActiveSheet()->removeConditionalStyles(); - $objPHPExcel->getActiveSheet()->setCellValue('A'.$line, $value['begintime'] . '-' . $value['endtime']); $product_name = $value['game_name']; $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['ratio'] . '%'); @@ -326,11 +321,8 @@ class AggregateFinanceStatementController extends ThinkController $objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getFont()->setBold(false); $line++; } - $objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $data['pay_money']);//合计-平台总额 $objPHPExcel->getActiveSheet()->setCellValue('F'.($line), $data['ratio_money']);//合计-结算金额 - - $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+1), $big_all_sum_money);//大写支付结算金额 //甲方信息 $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+3), $data['first_party_info']['partner']);//甲方 @@ -338,13 +330,11 @@ class AggregateFinanceStatementController extends ThinkController $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+5), $data['first_party_info']['link_phone']);//联系电话 $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+6), $data['second_party_info']['invoice_item']);//开票项目 $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+7), $data['second_party_info']['invoice_type']);//发票类型 - //乙方信息 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+3), $data['second_party_info']['partner']);//乙方 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+4), $data['second_party_info']['link_man']);//联系人 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+5), $data['second_party_info']['link_phone']);//联系电话 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+6), $data['second_party_info']['address']);//邮寄地址 - // $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+8), $value['pay_amount']);//请汇入此账号 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+8), $data['second_party_info']['payee_name']);//户名 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+9), $data['second_party_info']['bank_account']);//银行账号 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+10), $data['second_party_info']['opening_bank']);//开户行 From 6b5f60f8e6a18ecbf4793e7a052b792cfb7dcf68 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 24 Apr 2020 18:16:32 +0800 Subject: [PATCH 12/20] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=87=AD=E8=AF=81?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 75 +++++++++++ .../editVoucher.html | 120 ++++++++++++++++++ .../View/AggregateFinanceStatement/lists.html | 47 ++++++- .../uploadVoucher.html | 120 ++++++++++++++++++ 4 files changed, 361 insertions(+), 1 deletion(-) create mode 100644 Application/Admin/View/AggregateFinanceStatement/editVoucher.html create mode 100644 Application/Admin/View/AggregateFinanceStatement/uploadVoucher.html diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 9c8c954ae..8051c0c2a 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -261,6 +261,81 @@ class AggregateFinanceStatementController extends ThinkController $this->assign("data",$senddata); $this->display(); } + //上传凭证 + public function uploadVoucher() + { + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $this->assign("id",$id); + $this->display(); + } + //修改凭证 + public function editVoucher() + { + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $info = M("aggregate_statement","tab_")->field("id,verify_status,ext_field")->where("id = '{$id}'")->find(); + $this->assign("id",$id); + $this->assign("ext_field",$info['ext_field']); + $this->display(); + } + //保存凭证 + public function saveVoucher() + { + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + + $path = '/Uploads/'; + $upload = new \Think\Upload();// 实例化上传类 + $upload->maxSize = 0 ;// 设置附件上传大小 + $upload->exts = array('jpg', 'gif', 'png', 'jpeg');;// 设置附件上传类型 + $upload->rootPath = '.'.$path; // 设置附件上传根目录 + $upload->savePath = ''; // 设置附件上传(子)目录 + // 上传文件 + $info = $upload->upload(); + if(!$info) {// 上传错误提示错误信息 + $msg = $upload->getError(); + $array= array('status' => 0, 'info' => $msg); + }else{// 上传成功 + // + $pf = $path.$info['file']['savepath'].$info['file']['savename']; + $save = [ + "ext_field"=>$pf, + ]; + //获取旧值,存在删除 + $info = M("aggregate_statement","tab_")->field("id,verify_status,ext_field")->where("id = '{$id}'")->find(); + if(!empty($info['ext_field'])){ + unlink("./".$info['ext_field']); + } + //如果是开票状态就改状态 + if($info["verify_status"] == 3){ + $save['verify_status'] = 4; + $save['create_time'] = time(); + } + M("aggregate_statement","tab_")->where("id = '{$id}'")->save($save); + $array=array( + 'status' => 1, + "info"=>"上传成功", + "file_path"=>$pf, + ); + } + $this->ajaxReturn($array); + } + //删除凭证 + public function delVoucher(){ + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $info = M("aggregate_statement","tab_")->field("id,ext_field")->where("id = '{$id}'")->find(); + if(!empty($info['ext_field'])){ + unlink("./".$info['ext_field']); + } + M("aggregate_statement","tab_")->where("id = '{$id}'")->save(['ext_field'=>'']); + $this->ajaxReturn(array( + 'status' => 1, + 'info' => "删除成功" + )); + } + //导出 public function export() { diff --git a/Application/Admin/View/AggregateFinanceStatement/editVoucher.html b/Application/Admin/View/AggregateFinanceStatement/editVoucher.html new file mode 100644 index 000000000..b57b9a5f8 --- /dev/null +++ b/Application/Admin/View/AggregateFinanceStatement/editVoucher.html @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + +
+ + + + + + +
文件选择: + + 仅能添加一张凭证,重复添加将覆盖
+
+
+
确认修改
+
删除凭证
+
+
+
+ +
+
+ + + + + + diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index 72b77d20a..8b60e1004 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -178,7 +178,10 @@
{$data.admin_name} {$data.create_time} - 查看 + 查看 + 上传凭证 + 查看凭证 + 编辑凭证 @@ -377,6 +380,48 @@ content:'/admin.php?s=/AggregateFinanceStatement/editStatement/id/'+id }); }); + //上传凭证 + $(".uploadVoucher").click(function () { + var id = $(this).data("id"); + layer.open({ + type: 2, + title: "上传凭证", + shadeClose: true, + shade: 0.8, + area: ['60%', '60%'], + content:'/admin.php?s=/AggregateFinanceStatement/uploadVoucher/id/'+id, + end:function(){ + reload(); + } + }); + }); + //查看凭证 + $(".viewVoucher").click(function () { + var img = $(this).data("img"); + layer.open({ + type: 1, + title:false, + content:"" + }); + }); + //编辑凭证 + $(".editVoucher").click(function () { + var id = $(this).data("id"); + layer.open({ + type: 2, + title: "编辑凭证", + shadeClose: true, + shade: 0.8, + area: ['60%', '60%'], + content:'/admin.php?s=/AggregateFinanceStatement/editVoucher/id/'+id, + end:function(){ + reload(); + } + }); + }); + // + + // $("#downstream").click(function () { // layer.open({ diff --git a/Application/Admin/View/AggregateFinanceStatement/uploadVoucher.html b/Application/Admin/View/AggregateFinanceStatement/uploadVoucher.html new file mode 100644 index 000000000..45f383823 --- /dev/null +++ b/Application/Admin/View/AggregateFinanceStatement/uploadVoucher.html @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + +
+ + + + + + +
文件选择: + + 仅能添加一张凭证,重复添加将覆盖
+
+
+
确认添加
+
删除凭证
+
+
+
+ +
+
+ + + + + + From 990c62b06a5dfd39ae23e386e52a41573ede3b97 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 24 Apr 2020 19:45:29 +0800 Subject: [PATCH 13/20] =?UTF-8?q?=E6=89=B9=E6=B3=A8=E5=A2=9E=E5=88=A0?= =?UTF-8?q?=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...regateFinanceStatementController.class.php | 11 + .../View/AggregateFinanceStatement/lists.html | 388 +++++------------- Data/update.sql | 1 + 3 files changed, 118 insertions(+), 282 deletions(-) diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php index 8051c0c2a..144089765 100644 --- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php +++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php @@ -335,6 +335,17 @@ class AggregateFinanceStatementController extends ThinkController 'info' => "删除成功" )); } + //新增备注 + public function saveRemark(){ + if(!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; + $remark = $_REQUEST['remark']; + M("aggregate_statement","tab_")->where("id = '{$id}'")->save(['remark'=>$remark]); + $this->ajaxReturn(array( + 'status' => 1, + 'info' => "操作成功" + )); + } //导出 public function export() diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index 8b60e1004..bf2813157 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -51,9 +51,6 @@

聚合渠道结算单管理

流程说明:结算自动生成对账单--->发起人申请开票--->财务审核开票--->寄发票--->发起人上传收款凭证--->财务确认到账

- - -
@@ -107,10 +104,6 @@
- - - @@ -120,19 +113,14 @@ @@ -167,7 +155,7 @@
+ {$data.channel_name} {$data.begintime}-{$data.endtime} {$data.admin_name} {$data.create_time} - 查看 - 上传凭证 - 查看凭证 - 编辑凭证 - 新增备注 - 修改备注 - 查看备注 - - 撤销审核 - 撤销申请 - - - - - - - - 申请开票 - - - 编辑 - - - - - - - - - + + {$vo} +