From c335c1f0b39fe30629c2bfafbe2c7540b7e5d917 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 23 Jun 2020 13:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A5=E7=82=B9=E5=92=8C?= =?UTF-8?q?=E6=9C=88=E7=BB=93=E9=9B=86=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementSetController.class.php | 84 ++++++++++++------- 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementSetController.class.php b/Application/Admin/Controller/CompanyStatementSetController.class.php index 6c520083e..ef187639e 100644 --- a/Application/Admin/Controller/CompanyStatementSetController.class.php +++ b/Application/Admin/Controller/CompanyStatementSetController.class.php @@ -9,6 +9,11 @@ use Think\Controller; */ class CompanyStatementSetController extends Controller { public $cpapihost; + public $TYPE=[ + "0"=>"周结", + "1"=>"月结", + "2"=>"补点" + ]; public $token = "LYHTQDJS"; public function _initialize(){ @@ -71,7 +76,7 @@ class CompanyStatementSetController extends Controller { echo "∟----推广公司周结统计ok".PHP_EOL; $this->promoteUserPool(0,$stime); - echo "∟----推广个人月结&补点统计ok".PHP_EOL; + echo "∟----推广个人周结ok".PHP_EOL; } if($d == 1){ echo $nowdate.":".PHP_EOL; @@ -86,7 +91,7 @@ class CompanyStatementSetController extends Controller { echo "∟----推广公司月结&补点统计ok".PHP_EOL; $this->promoteUserPool(1,$stime); - $this->promoteUserPool(2,$stime); + // $this->promoteUserPool(2,$stime); echo "∟----推广个人月结&补点统计ok".PHP_EOL; } }else{ @@ -665,10 +670,54 @@ class CompanyStatementSetController extends Controller { $pcList[$k]['list'] = $v; } } + public function promoteUserPool($type,$stime,$recount = false){ + $t = $this->setBeginAndEndTime($type,$stime); + $begintime = $t[0]; + $endtime = $t[1]; + + $basedata = [ + "pay_amount"=>0, + "statement_money"=>0, + "lack_statement_money"=>0, + "withdraw_type"=>$type, + "platform_amount"=>0, + "create_lack_ids"=>[], + "del_lack_ids"=>[], + "statement_begin_time"=>$begintime, + "statement_end_time"=>$endtime, + "fine"=>0, + "reward"=>0, + "verify_status"=>0, + "company_type"=>2, + "verify_log"=>json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s")]), + "op_time"=>time() + ]; + $users = $user = $basedata; + $users['is_payment'] = 1; + $users['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3); + + $user['is_payment'] = 2; + $user['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3); + + + + if($type == 0){//周结 + $this->doPromoteUserPool($user,$users,$type,$stime,$recount); + }else{ + $users['withdraw_type'] = 1; + $user['withdraw_type'] = 1; + //月结&补点 + $this->doPromoteUserPool($user,$users,1,$stime,$recount); + $this->doPromoteUserPool($user,$users,2,$stime,$recount); + } + $this->savePromotateUserPool($users); + $this->savePromotateUserPool($user); + } + /** * 下游个人汇总单 */ - public function promoteUserPool($type,$stime,$recount = false) + public function doPromoteUserPool(&$user,&$users,$type,$stime,$recount = false) { $t = $this->setBeginAndEndTime($type,$stime); $begintime = $t[0]; @@ -718,33 +767,7 @@ class CompanyStatementSetController extends Controller { $RewardRecord = M("RewardRecord","tab_"); $LackStatement = M("company_lack_statement_info","tab_"); $StatementInfo = M("company_statement_info","tab_"); - $basedata = [ - "pay_amount"=>0, - "statement_money"=>0, - "lack_statement_money"=>0, - "withdraw_type"=>$type, - "platform_amount"=>0, - "create_lack_ids"=>[], - "del_lack_ids"=>[], - "statement_begin_time"=>$begintime, - "statement_end_time"=>$endtime, - "fine"=>0, - "reward"=>0, - "verify_status"=>0, - "company_type"=>2, - "verify_log"=>json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s")]), - "op_time"=>time() - ]; - $users = $user = $basedata; - $users['is_payment'] = 1; - $users['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3); - - $user['is_payment'] = 2; - $user['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3); - - // - foreach($pc as $k=>&$v){ //获取其他信息 $v = $this->getCompanyOtherInfo($v,$k); @@ -916,15 +939,12 @@ class CompanyStatementSetController extends Controller { } } } - $this->savePromotateUserPool($users,$type); - $this->savePromotateUserPool($user,$type); } /** * 保存信息汇总信息 */ public function savePromotateUserPool($data){ if(empty($data['create_lack_ids']) && empty($data['del_lack_ids']) && empty($data['info_ids'])){ return;} - if($data['statement_money'] == 0 && $type ==2){ return;} if($data['statement_money'] == 0){ $data['verify_status'] = 5; $data['verify_log'] = json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s"),"verify_user"=>"system","verify_time"=>date("Y-m-d H:i:s"),"payment_user"=>"system","payment_time"=>date("Y-m-d H:i:s")]);