11月功能提交

master
zhengyongxing 4 years ago
parent 41e9820d83
commit 9b87b9c4a1

@ -562,22 +562,22 @@ class CompanyGameRatioController extends AdminController
}
// dump($end_time);dump($begin_time);die();
$check_data = M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$begin_time,'end_time'=>$end_time])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$begin_time,'end_time'=>$end_time])
->find();
if ($check_data) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$begin_time,'end_time'=>$end_time])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$begin_time,'end_time'=>$end_time])
->save($ratiov);
return;
}
M("company_game_ratio","tab_")
// ->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>['egt',$begin_time],'end_time'=>['elt',$end_time]])
->where("company_belong={$company_belong} and company_id={$company_id} and relation_game_id={$relation_game_id} and begin_time>={$begin_time} and end_time <= {$end_time} and end_time!=0")
->where("company_id={$company_id} and relation_game_id={$relation_game_id} and begin_time>={$begin_time} and end_time <= {$end_time} and end_time!=0")
->delete();
$data = M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id])
->order("begin_time DESC")
->select();
@ -587,7 +587,7 @@ class CompanyGameRatioController extends AdminController
if (!$end_time) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->delete();
continue;
}
@ -598,18 +598,18 @@ class CompanyGameRatioController extends AdminController
if ($end_time > $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->save(['begin_time'=>$end_time+1]);
} else if ($end_time > $value['begin_time'] && ($end_time >= $value['end_time']&&$value['end_time']!=0)) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->save(['begin_time'=>$begin_time,'end_time'=>$end_time]);
}
} else if ($value['begin_time'] <= $begin_time) {
if (!$end_time&&($value['end_time']>$begin_time||$value['end_time']==0)) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->save(['end_time'=>$begin_time-1]);
continue;
}else if (!$end_time) {
@ -621,11 +621,11 @@ class CompanyGameRatioController extends AdminController
}
if ($begin_time > $value['begin_time'] && ($end_time >= $value['end_time'] && $value['end_time']!=0)) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->save(['end_time'=>$begin_time-1]);
} else if ($begin_time > $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->save(['end_time'=>$begin_time-1]);
$dataValue = $value;
$dataValue['begin_time'] = $end_time+1;
@ -634,15 +634,15 @@ class CompanyGameRatioController extends AdminController
} else if ($begin_time == $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->save(['begin_time'=>$end_time+1]);
} else if ($end_time == $value['end_time']&&$begin_time>$value['begin_time']) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->save(['end_time'=>$begin_time-1]);
} else if ($end_time == $value['end_time']&&$begin_time == $value['begin_time']) {
M("company_game_ratio","tab_")
->where(['company_belong'=>$company_belong,'company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->where(['company_id'=>$company_id,'relation_game_id'=>$relation_game_id,'begin_time'=>$value['begin_time'],'end_time'=>$value['end_time']])
->save(['begin_time'=>$begin_time,'end_time'=>$end_time]);
}

@ -1328,9 +1328,9 @@ class CompanyStatementSetController extends Controller {
$cpSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($cpMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
if ($company_id == 43) {
dump($cpMap);
}
// if ($company_id == 43) {
// dump($cpMap);
// }
foreach($cpSpendList as $ck=>$cv){
if(isset($cpgame[$cv['relation_game_id']])){
$cpgame[$cv['relation_game_id']]['pay_amount'] += $cv['pay_amount'];
@ -1398,9 +1398,9 @@ class CompanyStatementSetController extends Controller {
$cpSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($cpMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
if ($company_id == 43) {
dump($cpMap);
}
// if ($company_id == 43) {
// dump($cpMap);
// }
foreach($cpSpendList as $ck=>$cv){
if(isset($cpgame[$cv['relation_game_id']])){

@ -102,7 +102,7 @@
<tbody>
<tr>
<td class="l"><i class="mustmark">*</i>推广公司类型:</td>
<td class="l">推广公司类型:</td>
<td class="r">
<select id="company_belong" name="company_belong" class="select_gallery">
<option value="0">内团</option>
@ -113,7 +113,7 @@
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>推广公司:</td>
<td class="l">推广公司:</td>
<td class="r">
<select name="company_id" id="company_id" class="select_gallery">
<option value="">请选择公司</option>

Loading…
Cancel
Save