Merge branch 'feature/finance_statement723' of wmtx/platform into release

master
陈志 4 years ago committed by Gogs
commit e01c7e4e01

@ -395,7 +395,7 @@ class CompanyStatementController extends ThinkController
$ids = $_REQUEST['ids'];
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
foreach($dbres as $k=>&$v){
if(in_array($v['verify_status'],[3,4])) continue; //合作方确认后不进行重算
// if(in_array($v['verify_status'],[3,4])) continue; //合作方确认后不进行重算
//重算
$res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]);
if($res === false){

@ -25,7 +25,15 @@ class CompanyStatementSetController extends Controller {
}
$this->cpapihost = $cpapihost['value'];
}
public function setFreeDateCount($begin,$end='')
/**
* Undocumented function
*
* @param [type] $begin 开始时间 2020-04-01
* @param string $end 结束时间,默认今天
* @param string $company all/pc/cp/pu 全部 下游公司 上游 下游个人
* @return void
*/
public function setFreeDateCount($begin,$end='',$company='all')
{
if($end == '') $end = $begin;
//判断日期格式
@ -48,10 +56,10 @@ class CompanyStatementSetController extends Controller {
$datelist = get_date_list($starttime,$endtime,1);
$countdate = count($datelist);
for($i=0;$i<$countdate;$i++){
$this->setDailyCount($datelist[$i]);
$this->setDailyCount($datelist[$i],$company);
}
}
public function setDailyCount($stime="now")
public function setDailyCount($stime="now",$company='all')
{
if(!IS_CLI){
die("只支持脚本访问");
@ -67,33 +75,65 @@ class CompanyStatementSetController extends Controller {
if($w == 1 || $d == 1){
if($w == 1){
echo $nowdate.":".PHP_EOL;
echo "--周结begin".PHP_EOL;
$this->cpStatement(0,$stime);
echo "∟----CP周结统计ok".PHP_EOL;
$this->promoteCompanyStatement(0,$stime);
echo "∟----推广公司周结统计ok".PHP_EOL;
$this->promoteUserPool(0,$stime);
echo "∟----推广个人周结ok".PHP_EOL;
if($company == "all"){
echo $nowdate.":".PHP_EOL;
echo "--周结begin".PHP_EOL;
$this->cpStatement(0,$stime);
echo "∟----CP周结统计ok".PHP_EOL;
$this->promoteCompanyStatement(0,$stime);
echo "∟----推广公司周结统计ok".PHP_EOL;
$this->promoteUserPool(0,$stime);
echo "∟----推广个人周结ok".PHP_EOL;
}
if($company == "cp"){
$this->cpStatement(0,$stime);
echo "∟----CP周结统计ok".PHP_EOL;
}
if($company == "pc"){
$this->promoteCompanyStatement(0,$stime);
echo "∟----推广公司周结统计ok".PHP_EOL;
}
if($company == "pu"){
$this->promoteUserPool(0,$stime);
echo "∟----推广个人周结ok".PHP_EOL;
}
}
if($d == 1){
echo $nowdate.":".PHP_EOL;
echo "--月结&补点begin".PHP_EOL;
if($company == "all"){
echo $nowdate.":".PHP_EOL;
echo "--月结&补点begin".PHP_EOL;
$this->cpStatement(1,$stime);
$this->cpStatement(2,$stime);
echo "∟----CP月结&补点统计ok".PHP_EOL;
$this->cpStatement(1,$stime);
$this->cpStatement(2,$stime);
echo "∟----CP月结&补点统计ok".PHP_EOL;
$this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime);
echo "∟----推广公司月结&补点统计ok".PHP_EOL;
$this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime);
echo "∟----推广公司月结&补点统计ok".PHP_EOL;
$this->promoteUserPool(1,$stime);
$this->promoteUserPool(2,$stime);
echo "∟----推广个人月结&补点统计ok".PHP_EOL;
$this->promoteUserPool(1,$stime);
$this->promoteUserPool(2,$stime);
echo "∟----推广个人月结&补点统计ok".PHP_EOL;
}
if($company == "cp"){
$this->cpStatement(1,$stime);
$this->cpStatement(2,$stime);
echo "∟----CP月结&补点统计ok".PHP_EOL;
}
if($company == "pc"){
$this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime);
echo "∟----推广公司月结&补点统计ok".PHP_EOL;
}
if($company == "pu"){
$this->promoteUserPool(1,$stime);
$this->promoteUserPool(2,$stime);
echo "∟----推广个人月结&补点统计ok".PHP_EOL;
}
}
}else{
echo $nowdate."非周一和月初,无需任何处理".PHP_EOL;
@ -1175,6 +1215,8 @@ class CompanyStatementSetController extends Controller {
//重写用户
$savedata['verify_log'] = json_encode(["create_user"=>$admin_user,"create_time"=>date("Y-m-d H:i:s")]);
$savedata['verify_status'] = 0;
$savedata['confirm_status'] = 0;
$savedata['confirm_log'] = '';
$savedata['id'] = $dbres['id'];
return $StatementDb->save($savedata);
}

@ -185,7 +185,9 @@
<td class="r">
<input type="text" class="txt time time3" name="validity_start_time" value="" placeholder="生效开始时间">
&nbsp;-&nbsp;<input type="text" class="txt time time4" name="validity_end_time" value="" placeholder="生效结束时间">
<span class="notice-text" style="float: none;">结束时间不选默认永久</span>
</td>
</tr>
<tr>
@ -501,7 +503,7 @@
if(start>=end) {layer.msg('开始时间必须小于结束时间');$("#contact_end").val('');return false;}
return false;
});
$('.time3').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
@ -517,6 +519,7 @@
return false;
});
$(".time3").datetimepicker("setDate", new Date());
$('.time4').datetimepicker({
format: 'yyyy-mm-dd',

@ -183,6 +183,7 @@
<td class="r">
<input type="text" class="txt time time3" name="validity_start_time" value="{$data.validity_start_time}" placeholder="生效开始时间">
&nbsp;-&nbsp;<input type="text" class="txt time time4" name="validity_end_time" value="{$data.validity_end_time}" placeholder="生效结束时间">
<span class="notice-text" style="float: none;">结束时间不选默认永久</span>
</td>
</tr>

Loading…
Cancel
Save