外团推广功能提交

master
zhengyongxing 4 years ago
parent 859f5b58c9
commit 80b148d6c5

@ -1096,6 +1096,10 @@ class CompanyStatementSetController extends Controller {
->join("left join tab_game g on s.game_id = g.id")
->select();
if ($company_id == 64) {
dump($all_list);
}
if(empty($list)){continue;}
$game = [];
foreach($list as $k=>$v){
@ -1125,7 +1129,6 @@ class CompanyStatementSetController extends Controller {
$temp = 0;
for ($j=0; $j < count($v); $j++) {
$turnover_type = $this->getTurnoverType($v[$j],$company_id,$begintime,$endtime);
if ($turnover_type == 2) {
$temp += $allgame[$v[$j]]['pay_amount'];
} else {
@ -1156,7 +1159,18 @@ class CompanyStatementSetController extends Controller {
}else{
unset($v['game_id']);
$res[$company_id][$p_account][$v['relation_game_id']]= $v;
$res[$company_id][$p_account][$v['relation_game_id']]['all_pay_amount']= $game[$v['relation_game_id']]['pay_amount'];
$turnover_type = $this->getTurnoverType($v['relation_game_id'],$company_id,$begintime,$endtime);
if ($turnover_type == 2) {
// $temp += $allgame[$v[$j]]['pay_amount'];
$res[$company_id][$p_account][$v['relation_game_id']]['all_pay_amount']= $allgame[$v['relation_game_id']]['pay_amount'];
} else {
// $res[$company_id][$v[$j]]['ratio_pay_amount'] = $res[$company_id][$v[$j]]['pay_amount'];
$res[$company_id][$p_account][$v['relation_game_id']]['all_pay_amount']= $game[$v['relation_game_id']]['pay_amount'];
}
// $res[$company_id][$p_account][$v['relation_game_id']]['all_pay_amount']= $game[$v['relation_game_id']]['pay_amount'];
$res[$company_id][$p_account][$v['relation_game_id']]['game_type_name'] = $this->getGameTypeName($v['relation_game_id']);
}
}

@ -346,7 +346,7 @@ class MarketPercentageController extends ThinkController
$data = array_merge($data,[$sum]);
data2csv($data,'市场毛利统计',$title);
data2csv($data,'市场毛利统计(不结算)',$title);
}
$count = M("settleup_marketorder","tab_")
@ -1585,6 +1585,7 @@ class MarketPercentageController extends ThinkController
if ($data['is_start']) {
$time_start = $company_belong_game_data['begin_time'];
$data['begin_time'] = $company_belong_game_data['begin_time'];
}
$last_month = strtotime(date('Y-m-t',strtotime("-2 month")));
@ -1598,9 +1599,13 @@ class MarketPercentageController extends ThinkController
if ($data['begin_time'] < $last_month && $data['end_time'] <= $last_month) {
$this->ajaxReturn(['msg'=>"已经结算过的时间不能修改","status"=>0]);
} elseif ($data['begin_time'] <= $last_month && $data['end_time'] > $last_month) {
$data['begin_time'] = strtotime(date('Y-m-1',strtotime("-1 month")));
if($company_belong_game_data['end_time']<= $last_month) {
$data['end_time'] = $company_belong_game_data['end_time'];
} else {
$data['end_time'] = $last_month;
}
}
$belong_game = M("company_belong_game","tab_")
@ -1637,7 +1642,6 @@ class MarketPercentageController extends ThinkController
$game_ids[$key] = $value-0;
}
}
$data['is_start'] = 0;
if($data['begin_time']<strtotime(date("Y-m-1",strtotime('-1 month')))) {

@ -997,6 +997,15 @@ class TimingController extends AdminController {
$belong_map = "((begin_time<={$time_start} and (end_time >={$time_start} or end_time=0)) or (begin_time<={$time_end} and end_time >={$time_end}) or (end_time>={$time_start} and end_time <={$time_end}))";
}
if ($map['pay_time']) {
M("settleup_marketorder","tab_")
->where(['pay_time'=>$map['pay_time'],'is_settlement'=>0])
->delete();
} else {
M("settleup_marketorder","tab_")
->where('1=1')
->delete();
}
$data = M("auth_group")
->where(['title'=>['like','%市场%']])
@ -1041,6 +1050,10 @@ class TimingController extends AdminController {
}
if (!$spend_map['_string']) {
$spend_map['_string'] = "relation_game_id = 0";
}
$spend = M("spend","tab_")
->field("sum(pay_amount) as pay_amount,FROM_UNIXTIME(pay_time,'%Y-%m') pay_time,
substring_index(substring_index(tab_spend.game_name,'(',1),'(',-1) game_name,game_id,relation_game_id,tab_spend.sdk_version,
@ -1416,12 +1429,14 @@ class TimingController extends AdminController {
do {
$date = date('Y-m', strtotime($start . ' + ' . $i . ' month'));
$i++;
M("market_altogether","tab_")->where(['pay_time'=>$date])->delete();
$this->insertAllUserBonus($date);
} while ($date < date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')));
// $map['pay_time'] = [];
unset($map['pay_time']);
} else{
M("market_altogether","tab_")->where(['pay_time'=>$pay_time])->delete();
$this->insertAllUserBonus($pay_time);
}

@ -117,7 +117,7 @@
<tr>
<td class="l"><i class="mustmark">*</i>游戏:</td>
<td class="r">
<a class="ajax-view submit_btn mlspacing" data-id="{$data.id}" style="margin-left:0">选择游戏</a>
<a class="ajax-view submit_btn mlspacing" data-id="{$data.id}" data-is="{$data['is_start']}" style="margin-left:0">选择游戏</a>
<span class="notice-text"></span>
</td>
</tr>
@ -296,9 +296,13 @@
//获取游戏列表
var url = "{:U('MarketPercentage/getPromoteGame')}";
var id = $(this).attr('data-id');
var is_show = $(this).attr('data-is');
var checked = 'checked';
if (is_show == 1) {
layer.msg("已经结算过的时间不能修改游戏");
return;
}
$.post(url,{id:id},function(res){
if(res.code==1){

Loading…
Cancel
Save