内部公司功能提交

master
zhengyongxing 4 years ago
parent 1f3b2d1ec7
commit ab9be65422

@ -343,8 +343,9 @@ class MarketPercentageController extends ThinkController
$admin = $_SESSION['onethink_admin']['user_auth']['username']; $admin = $_SESSION['onethink_admin']['user_auth']['username'];
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$Rule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_export_show_check");
if ($_REQUEST['export'] && session('user_group_id') == 23) { if ($_REQUEST['export'] && $this->checkRule($Rule,array('in','1,2'))) {
if (!$value['market_check'] || !$value['finance_check']) { if (!$value['market_check'] || !$value['finance_check']) {
unset($data[$key]); unset($data[$key]);

@ -769,6 +769,7 @@ class TimingController extends AdminController {
$return = []; $return = [];
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$statement_info = json_decode($value['statement_info'],true); $statement_info = json_decode($value['statement_info'],true);
$is_inside = M("PromoteCompany","tab_")->field("is_inside")->where("id='{$value['company_id']}'")->find()['is_inside'];
if ($value['company_type'] == 2) { if ($value['company_type'] == 2) {
@ -777,9 +778,9 @@ class TimingController extends AdminController {
foreach ($info as $k => $v) { foreach ($info as $k => $v) {
// //
if (isset($return[$statement_info['promote_id'].$v['relation_game_id']])) { if (isset($return[$statement_info['promote_id'].$v['relation_game_id']])) {
$return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] = $v['sum_money']; $return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] = !$is_inside?$v['sum_money']:0;
} else { } else {
$return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] += $v['sum_money']; $return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] += !$is_inside?$v['sum_money']:0;
} }
} }
@ -811,7 +812,7 @@ class TimingController extends AdminController {
->group("promote_id") ->group("promote_id")
->find(); ->find();
$return[$value['company_id']."-".$promote_id."-".$v['relation_game_id']] += ($dataAmount['pay_amount']*$v['increment_ratio'])/100; $return[$value['company_id']."-".$promote_id."-".$v['relation_game_id']] += !$is_inside?(($dataAmount['pay_amount']*$v['increment_ratio'])/100):0;
} }
} }
@ -839,6 +840,13 @@ class TimingController extends AdminController {
$begintime = strtotime(date("Y-m-1",strtotime($date))); $begintime = strtotime(date("Y-m-1",strtotime($date)));
$endtime = strtotime(date("Y-m-t",strtotime($date)))+86399; $endtime = strtotime(date("Y-m-t",strtotime($date)))+86399;
$is_inside = M("PromoteCompany","tab_")->field("is_inside")->where("id='{$company_id}'")->find()['is_inside'];
if ($is_inside == 1) {
return 0;
}
$company_game_ratio = M("company_game_ratio","tab_") $company_game_ratio = M("company_game_ratio","tab_")
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id]) ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id])
->where("(end_time>={$begintime} and (end_time<={$endtime} and end_time!=0)) or (begin_time>={$begintime} and begin_time<={$endtime}) or (begin_time<={$begintime} and (end_time>={$endtime} or end_time=0))") ->where("(end_time>={$begintime} and (end_time<={$endtime} and end_time!=0)) or (begin_time>={$begintime} and begin_time<={$endtime}) or (begin_time<={$begintime} and (end_time>={$endtime} or end_time=0))")

@ -24,6 +24,8 @@ class CompanyGameRatioModel extends Model
$company_belong = M("PromoteCompany","tab_")->field("company_belong")->where("id='{$company_id}'")->find()['company_belong']; $company_belong = M("PromoteCompany","tab_")->field("company_belong")->where("id='{$company_id}'")->find()['company_belong'];
} }
$is_inside = M("PromoteCompany","tab_")->field("is_inside")->where("id='{$company_id}'")->find()['is_inside'];
$mwhere = [ $mwhere = [
"company_belong"=>$company_belong, "company_belong"=>$company_belong,
"relation_game_id"=>["in",$game_ids] "relation_game_id"=>["in",$game_ids]
@ -55,13 +57,13 @@ class CompanyGameRatioModel extends Model
if($v['end_time'] == 0 || ($v['end_time'] >= $last_time_ratio['endtime'])){ if($v['end_time'] == 0 || ($v['end_time'] >= $last_time_ratio['endtime'])){
//全段 //全段
if($v['begin_time'] <= $last_time_ratio['begintime']){ if($v['begin_time'] <= $last_time_ratio['begintime']){
$tgr[count($tgr)-1]['ratio'] = $v['ratio']; $tgr[count($tgr)-1]['ratio'] = !$is_inside?$v['ratio']:0;
$tgr[count($tgr)-1]['turnover_ratio'] = $v['turnover_ratio']; $tgr[count($tgr)-1]['turnover_ratio'] = !$is_inside?$v['turnover_ratio']:[];
continue; continue;
}else{ }else{
//上分段 //上分段
$tgr[count($tgr)-1]['endtime'] = $v['begin_time']-1; $tgr[count($tgr)-1]['endtime'] = $v['begin_time']-1;
$tgr[] = ['begintime'=>$v['begin_time'],"endtime"=>$last_time_ratio['endtime'],"ratio"=>$v['ratio'],"turnover_ratio"=>$v['turnover_ratio']]; $tgr[] = ['begintime'=>$v['begin_time'],"endtime"=>$last_time_ratio['endtime'],"ratio"=>!$is_inside?$v['ratio']:0,"turnover_ratio"=>!$is_inside?$v['turnover_ratio']:[]];
continue; continue;
} }
} }
@ -70,7 +72,7 @@ class CompanyGameRatioModel extends Model
//中段 //中段
$tgr[count($tgr)-1]['endtime'] = $v['begin_time']-1; $tgr[count($tgr)-1]['endtime'] = $v['begin_time']-1;
$tgr[] = ['begintime'=>$v['begin_time'],"endtime"=>$v['end_time'],"ratio"=>$v['ratio'],"turnover_ratio"=>$v['turnover_ratio']]; $tgr[] = ['begintime'=>$v['begin_time'],"endtime"=>$v['end_time'],"ratio"=>!$is_inside?$v['ratio']:0,"turnover_ratio"=>!$is_inside?$v['turnover_ratio']:[]];
$tgr[] = ['begintime'=>$v['end_time']-0+1,"endtime"=>$last_time_ratio['endtime']]; $tgr[] = ['begintime'=>$v['end_time']-0+1,"endtime"=>$last_time_ratio['endtime']];
continue; continue;
@ -78,13 +80,13 @@ class CompanyGameRatioModel extends Model
if($last_time_ratio['begintime'] > $v['begin_time']){ if($last_time_ratio['begintime'] > $v['begin_time']){
//下分段 //下分段
$tgr[count($tgr)-1]['endtime'] = $v['end_time']; $tgr[count($tgr)-1]['endtime'] = $v['end_time'];
$tgr[] = ['begintime'=>$v['end_time']-0+1,"endtime"=>$last_time_ratio['endtime'],"ratio"=>$v['ratio'],"turnover_ratio"=>$v['turnover_ratio']]; $tgr[] = ['begintime'=>$v['end_time']-0+1,"endtime"=>$last_time_ratio['endtime'],"ratio"=>!$is_inside?$v['ratio']:0,"turnover_ratio"=>!$is_inside?$v['turnover_ratio']:[]];
continue; continue;
} }
if($last_time_ratio['begintime'] = $v['begin_time']){ if($last_time_ratio['begintime'] = $v['begin_time']){
$tgr[count($tgr)-1]['endtime'] = $v['end_time']; $tgr[count($tgr)-1]['endtime'] = $v['end_time'];
$tgr[count($tgr)-1]['ratio'] = $v['ratio']; $tgr[count($tgr)-1]['ratio'] = !$is_inside?$v['ratio']:0;
$tgr[count($tgr)-1]['turnover_ratio'] = $v['turnover_ratio']; $tgr[count($tgr)-1]['turnover_ratio'] = !$is_inside?$v['turnover_ratio']:[];
$tgr[] = ['begintime'=>$v['end_time']-0+1,"endtime"=>$last_time_ratio['endtime']]; $tgr[] = ['begintime'=>$v['end_time']-0+1,"endtime"=>$last_time_ratio['endtime']];
} }
@ -95,8 +97,8 @@ class CompanyGameRatioModel extends Model
foreach($list as $i => &$ratio){ foreach($list as $i => &$ratio){
if(!isset($ratio['ratio'])){ if(!isset($ratio['ratio'])){
if(isset($modul_ratio[$k]['ratio'])){ if(isset($modul_ratio[$k]['ratio'])){
$ratio['ratio'] = $modul_ratio[$k]['ratio']; $ratio['ratio'] = !$is_inside?$modul_ratio[$k]['ratio']:0;
$ratio['turnover_ratio'] = $modul_ratio[$k]['turnover_ratio']; $ratio['turnover_ratio'] = !$is_inside?$modul_ratio[$k]['turnover_ratio']:null;
}else{ }else{
$ratio['ratio'] = 0; $ratio['ratio'] = 0;
$ratio['turnover_ratio'] =null; $ratio['turnover_ratio'] =null;

@ -127,8 +127,12 @@
<div class="butnbox" > <div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px"> <div class="butnlist jscheckbutn" style="margin-left: 2px">
<if condition="$market_check eq true">
<a class='butn' id='market_check' style='background-color: #3C95C8;'>市场部确认</a> <a class='butn' id='market_check' style='background-color: #3C95C8;'>市场部确认</a>
</if>
<if condition="$finance_check eq true">
<a class='butn' id='finance_check' style='background-color: #3C95C8;'>财务部审批</a> <a class='butn' id='finance_check' style='background-color: #3C95C8;'>财务部审批</a>
</if>
</div> </div>
</div> </div>

Loading…
Cancel
Save