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(); // dump($end_time);dump($begin_time);die();
$check_data = M("company_game_ratio","tab_") $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(); ->find();
if ($check_data) { if ($check_data) {
M("company_game_ratio","tab_") 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); ->save($ratiov);
return; return;
} }
M("company_game_ratio","tab_") 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_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(); ->delete();
$data = M("company_game_ratio","tab_") $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") ->order("begin_time DESC")
->select(); ->select();
@ -587,7 +587,7 @@ class CompanyGameRatioController extends AdminController
if (!$end_time) { if (!$end_time) {
M("company_game_ratio","tab_") 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(); ->delete();
continue; continue;
} }
@ -598,18 +598,18 @@ class CompanyGameRatioController extends AdminController
if ($end_time > $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) { if ($end_time > $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) {
M("company_game_ratio","tab_") 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]); ->save(['begin_time'=>$end_time+1]);
} else if ($end_time > $value['begin_time'] && ($end_time >= $value['end_time']&&$value['end_time']!=0)) { } else if ($end_time > $value['begin_time'] && ($end_time >= $value['end_time']&&$value['end_time']!=0)) {
M("company_game_ratio","tab_") 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]); ->save(['begin_time'=>$begin_time,'end_time'=>$end_time]);
} }
} else if ($value['begin_time'] <= $begin_time) { } else if ($value['begin_time'] <= $begin_time) {
if (!$end_time&&($value['end_time']>$begin_time||$value['end_time']==0)) { if (!$end_time&&($value['end_time']>$begin_time||$value['end_time']==0)) {
M("company_game_ratio","tab_") 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]); ->save(['end_time'=>$begin_time-1]);
continue; continue;
}else if (!$end_time) { }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)) { if ($begin_time > $value['begin_time'] && ($end_time >= $value['end_time'] && $value['end_time']!=0)) {
M("company_game_ratio","tab_") 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]); ->save(['end_time'=>$begin_time-1]);
} else if ($begin_time > $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) { } else if ($begin_time > $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) {
M("company_game_ratio","tab_") 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]); ->save(['end_time'=>$begin_time-1]);
$dataValue = $value; $dataValue = $value;
$dataValue['begin_time'] = $end_time+1; $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)) { } else if ($begin_time == $value['begin_time'] && ($end_time < $value['end_time']||$value['end_time']==0)) {
M("company_game_ratio","tab_") 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]); ->save(['begin_time'=>$end_time+1]);
} else if ($end_time == $value['end_time']&&$begin_time>$value['begin_time']) { } else if ($end_time == $value['end_time']&&$begin_time>$value['begin_time']) {
M("company_game_ratio","tab_") 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]); ->save(['end_time'=>$begin_time-1]);
} else if ($end_time == $value['end_time']&&$begin_time == $value['begin_time']) { } else if ($end_time == $value['end_time']&&$begin_time == $value['begin_time']) {
M("company_game_ratio","tab_") 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]); ->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') $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") ->join("left join tab_game g on s.game_id = g.id")
->select(); ->select();
if ($company_id == 43) { // if ($company_id == 43) {
dump($cpMap); // dump($cpMap);
} // }
foreach($cpSpendList as $ck=>$cv){ foreach($cpSpendList as $ck=>$cv){
if(isset($cpgame[$cv['relation_game_id']])){ if(isset($cpgame[$cv['relation_game_id']])){
$cpgame[$cv['relation_game_id']]['pay_amount'] += $cv['pay_amount']; $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') $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") ->join("left join tab_game g on s.game_id = g.id")
->select(); ->select();
if ($company_id == 43) { // if ($company_id == 43) {
dump($cpMap); // dump($cpMap);
} // }
foreach($cpSpendList as $ck=>$cv){ foreach($cpSpendList as $ck=>$cv){
if(isset($cpgame[$cv['relation_game_id']])){ if(isset($cpgame[$cv['relation_game_id']])){

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

Loading…
Cancel
Save