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

优化重算按钮的出现
master
陈志 4 years ago committed by Gogs
commit e1db5c9a47

@ -114,7 +114,7 @@ class CompanyStatementSetController extends Controller {
$this->promoteCompanyStatement(1,$stime); $this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime); $this->promoteCompanyStatement(2,$stime);
$this->officeCompanyStatement($stime); //官方结算 $this->officeCompanyStatement($stime); //官方结算
echo "∟----推广公司月结&补点统计ok".PHP_EOL; echo "∟----官方/推广公司月结&补点统计ok".PHP_EOL;
$this->promoteUserPool(1,$stime); $this->promoteUserPool(1,$stime);
$this->promoteUserPool(2,$stime); $this->promoteUserPool(2,$stime);
@ -129,7 +129,7 @@ class CompanyStatementSetController extends Controller {
$this->promoteCompanyStatement(1,$stime); $this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime); $this->promoteCompanyStatement(2,$stime);
$this->officeCompanyStatement($stime); //官方结算 $this->officeCompanyStatement($stime); //官方结算
echo "∟----推广公司月结&补点统计ok".PHP_EOL; echo "∟----官方/推广公司月结&补点统计ok".PHP_EOL;
} }
if($company == "pu"){ if($company == "pu"){
$this->promoteUserPool(1,$stime); $this->promoteUserPool(1,$stime);

@ -165,6 +165,12 @@ class FinancialSummaryController extends AdminController
} }
public function menuAuth() public function menuAuth()
{ {
$isCan = D("CmdTasks")->isCanAddTask("FinancialSummary");
if(!$isCan){
return [];
}
$mentBtn = [ $mentBtn = [
"updateStatement"=>"<a class='butn' id='updateStatement' style='background-color: green;'>重算金额</a>" "updateStatement"=>"<a class='butn' id='updateStatement' style='background-color: green;'>重算金额</a>"
]; ];

@ -43,10 +43,8 @@ class CmdTasksModel extends Model{
//插入任务 //插入任务
public function addTask($type,$params,$need_path=true) public function addTask($type,$params,$need_path=true)
{ {
$task = $this->field("end_time")->where(['status'=>["in","0,1"],'type'=>$type])->order("id desc")->find(); if(!$this->isCanAddTask($type)) return false;
if(!empty($task)){
return false;
}
if($need_path){ if($need_path){
if(IS_WIN){ if(IS_WIN){
$p = explode(':',ROOTTTTT); $p = explode(':',ROOTTTTT);
@ -64,4 +62,13 @@ class CmdTasksModel extends Model{
]; ];
return $this->add($save); return $this->add($save);
} }
//验证任务
public function isCanAddTask($type)
{
$task = $this->field("end_time")->where(['status'=>["in","0,1"],'type'=>$type])->order("id desc")->find();
if(!empty($task)){
return false;
}
return true;
}
} }

@ -72,9 +72,9 @@
</div> </div>
<div class="input-list input-list-resway search_label_rehab"> <div class="input-list input-list-resway search_label_rehab">
<select id="type" name="type" class="select_gallery" style="width:150px;"> <select id="type" name="type" class="select_gallery" style="width:150px;">
<option value="2" <if condition="I('type') && $vo.value eq 2">selected <option value="2" <if condition="I('type') && I('type') eq 2">selected
</if> >不包含绑币</option> </if> >不包含绑币</option>
<option value="3" <if condition="I('type') && $vo.value eq 3">selected <option value="3" <if condition="I('type') && I('type') eq 3">selected
</if> >包含绑币</option> </if> >包含绑币</option>
</select> </select>
</div> </div>
@ -285,14 +285,16 @@
window.location.href = url; window.location.href = url;
}); });
$("#updateStatement").on("click",function(){ $("#updateStatement").on("click",function(){
layer.confirm("新增结算需要花费2分钟左右时间,并且只上个月统计信息,无需结算请取消,上次重算时间【{$lastRecount}】",{title:false}, function(index){ layer.confirm("重算需要花费2分钟左右时间,并且只统计上个月信息,无需重算请取消,上次重算时间【{$lastRecount}】",{title:false}, function(index){
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: "{:U('updateStatement')}", url: "{:U('updateStatement')}",
data:{}, data:{},
success: function(data) { success: function(data) {
if(data.success){ if(data.success){
layer.alert('添加重算任务成功请2分钟后刷新查看'); layer.alert('添加重算任务成功请2分钟后刷新查看',function(){
window.location.reload();
});
}else{ }else{
layer.alert('添加任务失败,已有重算任务。请等待上个重算任务完成'); layer.alert('添加任务失败,已有重算任务。请等待上个重算任务完成');
} }

Loading…
Cancel
Save