|
|
@ -141,6 +141,9 @@ class GameMarginController extends AdminController
|
|
|
|
$item["jh_margin_amount"] = round( $item["jh_statement_amount"]-$item["jh_pay_amount"]*(1-$item['cp_promote_ratio']/100)*($item["cp_ratio"]+$item['cp_rebate_ratio'])/100 ,2);
|
|
|
|
$item["jh_margin_amount"] = round( $item["jh_statement_amount"]-$item["jh_pay_amount"]*(1-$item['cp_promote_ratio']/100)*($item["cp_ratio"]+$item['cp_rebate_ratio'])/100 ,2);
|
|
|
|
$item["jh_margin_ratio"] = round($item["jh_margin_amount"]/$item['jh_pay_amount'],4)*100;
|
|
|
|
$item["jh_margin_ratio"] = round($item["jh_margin_amount"]/$item['jh_pay_amount'],4)*100;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$item['margin_amount'] = round( ($item['pay_amount']-$item['cp_statement_amount']-$item['cp_rebate_amount']-$item['cp_other_amount']-$item['pc_statement_amount']-$item['pu_statement_amount']+$item['jh_statement_amount']),2);
|
|
|
|
|
|
|
|
$item['margin_ratio'] = round($item['margin_amount']/$item['pay_amount'],4)*100;
|
|
|
|
|
|
|
|
|
|
|
|
$margin_amount = 0;
|
|
|
|
$margin_amount = 0;
|
|
|
|
//总计
|
|
|
|
//总计
|
|
|
|
foreach ($marginInfo as &$v) {
|
|
|
|
foreach ($marginInfo as &$v) {
|
|
|
@ -156,7 +159,23 @@ class GameMarginController extends AdminController
|
|
|
|
$this->DBModel->where("id='{$params['id']}'")->save($save);
|
|
|
|
$this->DBModel->where("id='{$params['id']}'")->save($save);
|
|
|
|
$this->ajaxReturn(['status'=>1,'msg'=>"修改成功,刷新。。。"]);
|
|
|
|
$this->ajaxReturn(['status'=>1,'msg'=>"修改成功,刷新。。。"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function recount()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!isset($_REQUEST['id'])) $this->error("参数错误");
|
|
|
|
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
|
|
|
|
$data = $this->DBModel->field("count_year,count_month")->where("id='{$id}'")->find();
|
|
|
|
|
|
|
|
$time = $data['count_year']."-".$data['count_month'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->DBModel->where("id='{$id}'")->delete();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$params = "php ".SUBSITE_INDEX." GameMarginSet/setFreeMonth/recount/1/count_date/{$time}";
|
|
|
|
|
|
|
|
$r = D("CmdTasks")->addTask("GameMargin",$params,true);
|
|
|
|
|
|
|
|
if($r){
|
|
|
|
|
|
|
|
$this->ajaxReturn(["status"=>"1",'msg'=>"任务添加成功,大约需等待5分钟后生成"]);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$this->ajaxReturn(["error"=>"error","msg"=>'任务添加失败']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|