外团推广功能提交

master
zhengyongxing 4 years ago
parent 0f44573fe2
commit 25e710c27e

@ -1596,6 +1596,14 @@ class MarketPercentageController extends ThinkController
$data['end_time'] = $last_month;
// $this->ajaxReturn(['msg'=>"过去已结算过的比例不能修改","status"=>0]);
}
$last_month_first = strtotime(date('Y-m-1',strtotime("-1 month")));
if ($company_belong_game_data['begin_time'] > $last_month && $data['begin_time'] < $last_month)
{
// $time_end = $last_month;
$data['begin_time'] = $last_month_first;
// $this->ajaxReturn(['msg'=>"过去已结算过的比例不能修改","status"=>0]);
}
if ($data['begin_time'] < $last_month && $data['end_time'] <= $last_month) {

@ -983,27 +983,29 @@ class TimingController extends AdminController {
$spend_map = [];
$time_start = 0;
$time_end = 0;
$month_time = [];
if($_REQUEST['time'] == 'all') {
$belong_map = [];
$map = [];
$month_time[] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01'));
$month_time[] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-2).'-01'));
$map['pay_time'] = ['in',$month_time];
$spend_map['pay_time'] = ['elt',strtotime(date('Y-m-t 23:59:59', strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')))];
} else {
$month_time = $map['pay_time'];
$time_start = strtotime(date('Y-m-1',strtotime($map['pay_time'])));
$time_end = strtotime(date('Y-m-t',strtotime($map['pay_time'])));
$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']])
->delete();
} else {
M("settleup_marketorder","tab_")
->where('1=1')
->where(['pay_time'=>['in',$month_time]])
->delete();
}
@ -1170,13 +1172,17 @@ class TimingController extends AdminController {
// ->where(['company_id'=>313,'spend.promote_id'=>4359,'relation_game_id'=>191])
// ->order("is_settlement ASC")
->select();
// dump($promote_data);die();
$specialPayAmount = [];
$unsettlement_amount = [];
foreach ($promote_data as $key => $value) {
if ($value['pay_time'] == date("Y-m",time())) {
continue;
}
$cp_radio = getGameCpRadio($value['game_id'],$value['pay_amount'],true);
if (!$cp_radio) {
$cp_radio = getGameCpRadio($value['game_id'],$value['pay_amount'],false);
@ -1359,7 +1365,7 @@ class TimingController extends AdminController {
unset($promote_data[$key]['market_percentage']);
$marker_data = M("settleup_marketorder","tab_")
->where(['pay_time'=>$value['pay_time'],'promote_id'=>$value['promote_id'],'game_name'=>$value['game_name'],'admin_id'=>$value['admin_id']])
->where(['pay_time'=>$value['pay_time'],'promote_id'=>$value['promote_id'],'game_name'=>$value['game_name'],'admin_id'=>$value['admin_id'],'is_settlement'=>$value['is_settlement']])
->find();
echo "日期:{$value['pay_time']},游戏:{$value['game_name']},推广员:{$value['promote_account']}\n";
echo "市场员:{$value['admin_id']} 推广员:{$value['promote_id']} 公司id{$value['company_id']} 游戏关联id{$value['relation_game_id']} 支付时间:{$value['pay_time']} 金额:{$value['pay_amount']}\n";

Loading…
Cancel
Save