|
|
|
@ -33,7 +33,7 @@ class SubCompanyStatementSetController extends Controller {
|
|
|
|
|
* @param string $company all/pc/cp/pu 全部 下游公司 上游 下游个人
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function setFreeDateCount($begin,$end='',$company='all')
|
|
|
|
|
public function setFreeDateCount($begin,$end='',$utime=false,$company='all')
|
|
|
|
|
{
|
|
|
|
|
if($end == '') $end = $begin;
|
|
|
|
|
//判断日期格式
|
|
|
|
@ -58,6 +58,9 @@ class SubCompanyStatementSetController extends Controller {
|
|
|
|
|
for($i=0;$i<$countdate;$i++){
|
|
|
|
|
$this->setDailyCount($datelist[$i],$company);
|
|
|
|
|
}
|
|
|
|
|
if($utime){
|
|
|
|
|
M("Kv","sub_",SUBSITE_DB)->where("`key` = 'sub_company_statement'")->save(["value"=>$utime]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public function setDailyCount($stime="now",$company='all')
|
|
|
|
|
{
|
|
|
|
@ -74,14 +77,14 @@ class SubCompanyStatementSetController extends Controller {
|
|
|
|
|
$w = (int)date("w",$stime);
|
|
|
|
|
if($w == 1){
|
|
|
|
|
if($company == "all"){
|
|
|
|
|
echo $nowdate.":".PHP_EOL;
|
|
|
|
|
echo "--周结begin".PHP_EOL;
|
|
|
|
|
// echo $nowdate.":".PHP_EOL;
|
|
|
|
|
// echo "--周结begin".PHP_EOL;
|
|
|
|
|
|
|
|
|
|
$this->cpStatement(0,$stime);
|
|
|
|
|
echo "∟----CP周结统计ok".PHP_EOL;
|
|
|
|
|
// echo "∟----CP周结统计ok".PHP_EOL;
|
|
|
|
|
|
|
|
|
|
$this->promoteCompanyStatement(0,$stime);
|
|
|
|
|
echo "∟----推广公司周结统计ok".PHP_EOL;
|
|
|
|
|
// echo "∟----推广公司周结统计ok".PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
if($company == "cp"){
|
|
|
|
|
$this->cpStatement(0,$stime);
|
|
|
|
@ -94,19 +97,18 @@ class SubCompanyStatementSetController extends Controller {
|
|
|
|
|
}
|
|
|
|
|
if($d == 1){
|
|
|
|
|
if($company == "all"){
|
|
|
|
|
echo $nowdate.":".PHP_EOL;
|
|
|
|
|
echo "--月结&补点begin".PHP_EOL;
|
|
|
|
|
// echo $nowdate.":".PHP_EOL;
|
|
|
|
|
// echo "--月结&补点begin".PHP_EOL;
|
|
|
|
|
|
|
|
|
|
$this->cpStatement(1,$stime);
|
|
|
|
|
echo "∟----CP月结&补点统计ok".PHP_EOL;
|
|
|
|
|
// echo "∟----CP月结&补点统计ok".PHP_EOL;
|
|
|
|
|
|
|
|
|
|
$this->promoteCompanyStatement(1,$stime);
|
|
|
|
|
|
|
|
|
|
$this->officeCompanyStatement($stime); //官方结算
|
|
|
|
|
echo "∟----官方/推广公司月结统计ok".PHP_EOL;
|
|
|
|
|
// echo "∟----官方/推广公司月结统计ok".PHP_EOL;
|
|
|
|
|
|
|
|
|
|
$this->promoteUserPool(1,$stime);
|
|
|
|
|
echo "∟----推广个人月结统计ok".PHP_EOL;
|
|
|
|
|
// echo "∟----推广个人月结统计ok".PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
if($company == "cp"){
|
|
|
|
|
$this->cpStatement(1,$stime);
|
|
|
|
@ -122,9 +124,9 @@ class SubCompanyStatementSetController extends Controller {
|
|
|
|
|
echo "∟----推广个人月结&补点统计ok".PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if($w != 1 && $d != 1){
|
|
|
|
|
echo $nowdate."非月初,无需任何处理".PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
// if($w != 1 && $d != 1){
|
|
|
|
|
// echo $nowdate."非月初,无需任何处理".PHP_EOL;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 上游结算
|
|
|
|
|