Merge branch 'feature/market_percentage' of wmtx/platform into release

市场专员业绩计bug修正
master
廖金灵 5 years ago committed by Gogs
commit 65288392e3

@ -640,6 +640,7 @@ class AdminController extends Controller {
public function checkListOrCountAuthRestMap(&$map,$checkarr = false,$countfield = "rule_count_check"){
//验证count
if(IS_ROOT){
$this->assign('caculate_check',true);
$this->assign('role_export_check',true);
$this->assign($countfield,true);
}else{
@ -651,10 +652,10 @@ class AdminController extends Controller {
$exportRule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME."_caculate_check");
$this->assign('caculate_check',$this->checkRule($exportRule,array('in','1,2')));
$caculateRule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME."_caculate_check");
$this->assign('caculate_check',$this->checkRule($caculateRule,array('in','1,2')));
// var_dump($caculateRule);die();
$countRule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME."_count_check");
$this->assign($countfield,$this->checkRule($countRule,array('in','1,2')));

@ -336,7 +336,6 @@ class MarketPercentageController extends ThinkController
public function personMarketStaffSettle($row = 10, $p = 1) {
// getDateMarket();die();
$map = [];
$map['group_id'] = ['in','11,12,21'];
@ -762,6 +761,11 @@ class MarketPercentageController extends ThinkController
->where(['pay_time'=>$data[$key]['pay_time'],'admin_id'=>$data[$key]['admin_id']])
->find();
if ($is_hav) {
//已发放不再修改状态
if ($is_hav['type'] == 2) {
$insert['type'] = 2;
}
// $this->ajaxReturn(['status'=>1,'msg'=>'已经发放过']);
$is_add = M("market_altogether","tab_")
->where(['pay_time'=>$data[$key]['pay_time'],'admin_id'=>$data[$key]['admin_id']])
@ -786,7 +790,10 @@ class MarketPercentageController extends ThinkController
// dump($map['pay_time']);die();
foreach($data as $key => $value) {
$sign = 0;
if (!$data[$key]['extend_commission']) {
$sign = 1;
}
$market_percentage = json_decode($value['market_percentage'],true);
if ($market_percentage['time'] == 1) {
@ -822,10 +829,11 @@ class MarketPercentageController extends ThinkController
}
$update['extend_commission'] = $data[$key]['extend_commission'];
if ($sign) {
M("market_altogether","tab_")
->where(['pay_time'=>$data[$key]['pay_time'],'admin_id'=>$data[$key]['admin_id']])
->save($update);
}
}

@ -194,9 +194,6 @@ class PayChannelController extends ThinkController
$this->assign('spreadData',$spreadData);
if($map['payed_time']) {
$map['pay_time'] = $map['payed_time'];
}
$channelData = $this->getPayChannel($map);
$testOrderChannelDatas = $this->getTestOrderPayChannel($maptestorder);
$payTypeData['支付宝支付金额'] = 0;

@ -951,16 +951,34 @@ class TimingController extends AdminController {
$map['pay_time'] = date("Y-m",strtotime('-1 month'));
if ($_REQUEST['pay_time']) {
$map['pay_time'] = $_REQUEST['pay_time'];
}
if ($_REQUEST['pay_time'] == 'all') {
$end = date("Y-m",time());
$start = '2019-08';
} elseif($_REQUEST['pay_time']) {
$end = $_REQUEST['pay_time'];
$start = $_REQUEST['pay_time'];
} else {
$end = date("Y-m",strtotime('-1 month'));
$start = date("Y-m",strtotime('-1 month'));
}
$i = 0;
do {
$date = date('Y-m', strtotime($start . ' + ' . $i . ' month'));
echo "{$date}:";
$i++;
$map['pay_time'] = $date;
//所有管理员插入数据
$this->insertAllUserBonus($map['pay_time']);
$month = date("m",strtotime($_REQUEST['pay_time']));
$yes = date("Y",strtotime($_REQUEST['pay_time']));
$month = date("m",strtotime($date));
$yes = date("Y",strtotime($date));
$all_data = M("settleup_marketorder","tab_")
->field("tab_settleup_marketorder.id,pay_time,promote_account,company_belong,tab_settleup_marketorder.real_name,develop_type,game_name,
@ -1079,7 +1097,7 @@ class TimingController extends AdminController {
$month = date("m",strtotime($value['pay_time']));
$yes = date("Y",strtotime($value['pay_time']));
$check_month = date("m",strtotime($_REQUEST['pay_time']));
$check_month = date("m",strtotime($date));
$insert['pay_time'] = $data[$key]['pay_time'];
$insert['admin_id'] = $data[$key]['admin_id'];
@ -1201,7 +1219,7 @@ class TimingController extends AdminController {
->where(['pay_time'=>['in',array_unique($where['month'])],'admin_id'=>$value['admin_id']])
->save(['type'=>2]);
}
$data[$key]['extend_commission'] +=$wait_amount[$value['admin_id'] . date("Y-m",strtotime("last month",strtotime($_REQUEST['pay_time'])))];
$data[$key]['extend_commission'] +=$wait_amount[$value['admin_id'] . date("Y-m",strtotime("last month",strtotime($date)))];
}
$update['extend_commission'] = $data[$key]['extend_commission'];
@ -1212,6 +1230,12 @@ class TimingController extends AdminController {
}
} while ($date < date('Y-m', strtotime("{$end} -1 month")));
echo date("Y-m-d H:i:s")."----------------------月初发放市场专员应发份额----------------------\n";
}

Loading…
Cancel
Save