diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index afba1b39e..0fb7f9b3d 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -758,8 +758,10 @@ class ConsoleController extends Think { public function shiftPromote() { - $fromAccount = 'longyan'; - $toAccount = 'nola2021'; + return; + $fromAccount = 'hskj6868'; //1874 + $toAccount = 'huyou1'; //1068 + $shiftIds = [3706]; $formPromote = M('promote', 'tab_')->where(['account' => $fromAccount])->find(); $toPromote = M('promote', 'tab_')->where(['account' => $toAccount])->find(); @@ -768,23 +770,24 @@ class ConsoleController extends Think { var_dump([ 'from_promote_id' => $formPromote['id'], 'to_promote_id' => $toPromote['id'], - 'shift_ids' => '', + 'shift_ids' => json_encode($shiftIds), ]); $service = new PromoteService(); $service->shiftPromote([ 'from_promote_id' => $formPromote['id'], 'to_promote_id' => $toPromote['id'], - 'shift_ids' => '', + 'shift_ids' => json_encode($shiftIds), ]); - M('promote', 'tab_')->where(['level1_id' => $formPromote['id'], 'company_id' => $formPromote['company_id']])->save([ + + M('promote', 'tab_')->where(['level1_id' => $toPromote['id'], 'level2_id' => 3706, 'company_id' => $formPromote['company_id']])->save([ 'company_id' => $toPromote['company_id'], 'admin_id' => $toPromote['admin_id'], ]); - if (count($ids)) { - $orderTime = strtotime('2021-08-01 00:00:00'); + /* if (count($ids)) { + $orderTime = strtotime('2021-09-01 00:00:00'); M('deposit', 'tab_')->where(['promote_id' => ['in', $ids], 'create_time' => ['egt', $orderTime]])->save(['market_admin_id' => $toPromote['admin_id']]); M('spend', 'tab_')->where(['promote_id' => ['in', $ids], 'spend_time' => ['egt', $orderTime]])->save(['market_admin_id' => $toPromote['admin_id']]); - } + } */ } } diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index d22c1a7ae..97953dcdd 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -519,16 +519,16 @@ class MarketPercentageController extends ThinkController unset($_GET['is_get']); $data = $_GET; - $if_coefficientSave = M("market_altogether", "tab_") - ->where([ - 'pay_time' => $pay_time, - 'market_check' => 1 - ]) - ->find(); + // $if_coefficientSave = M("market_altogether", "tab_") + // ->where([ + // 'pay_time' => $pay_time, + // 'market_check' => 1 + // ]) + // ->find(); - if ($if_coefficientSave) { - $this->ajaxReturn(['status' => 0, 'msg' => "市场部已确认,绩效系数再不可修改"]); - } + // if ($if_coefficientSave) { + // $this->ajaxReturn(['status' => 0, 'msg' => "市场部已确认,绩效系数再不可修改"]); + // } $admin = $_SESSION['onethink_admin']['user_auth']['username']; $coefficient_check_detail = "已审批({$admin})
" . date("Y-m-d H:i:s", time()); @@ -583,9 +583,19 @@ class MarketPercentageController extends ThinkController } else { + $uids = M("market_altogether", "tab_") + ->where([ + 'pay_time' => $pay_time, + 'market_check' => 0 + ]) + ->getField('admin_id',true); + if($uids){ + $uids = implode(",",$uids); + $map['_string'] = "sys_auth_group_access.uid in ({$uids})"; + } + $map['sys_auth_group_access.uid'] =['in',$this->MarketEvent->getAdminidByLeaderid()]; $map['auth.id'] =['in',$this->MarketEvent->getNoLeaderMarketGroupId()]; - $data = M("auth_group_access") ->field("sys_member.nickname,sys_member.real_name,sys_member.uid,sys_auth_group_access.group_id,IF(coefficient is not NULL, coefficient, 100) coefficient,sys_ucenter_member.leave_time") ->join("left join sys_auth_group auth on auth.id = sys_auth_group_access.group_id") diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index 9e1a14f25..0bc388bcd 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -1076,19 +1076,20 @@ class TimingController extends AdminController { $group_config = json_decode($group_config['market_percentage'],true); $month = date("m",strtotime($value['pay_time'])); $yes = date("Y",strtotime($value['pay_time'])); - $where =[]; - + if ($group_config['time'] == 1) { -// var_dump($month);die(); if ($month == '07') { - $where = [$yes.'-'.'01',$yes.'-'.'02',$yes.'-'.'03']; - } elseif($month == '10') { $where = [$yes.'-'.'04',$yes.'-'.'05',$yes.'-'.'06']; - } elseif($month == '04') { + } + if($month == '10') { + $where = [$yes.'-'.'07',$yes.'-'.'08',$yes.'-'.'09']; + } + if($month == '04') { + $where = [$yes.'-'.'01',$yes.'-'.'02',$yes.'-'.'03']; + } + if($month == '01') { $where = [($yes-1).'-'.'10',($yes-1).'-'.'11',($yes-1).'-'.'12']; - } elseif($month == '01') { - $where = [($yes-1).'-'.'07',($yes-1).'-'.'08',($yes-1).'-'.'09']; } } elseif($group_config['time'] == 2) { diff --git a/Application/Admin/View/MarketPercentage/coefficient.html b/Application/Admin/View/MarketPercentage/coefficient.html index a48112313..b5724407a 100644 --- a/Application/Admin/View/MarketPercentage/coefficient.html +++ b/Application/Admin/View/MarketPercentage/coefficient.html @@ -103,20 +103,24 @@ - aOh! 暂时还没有内容! + aOh! 暂时无需要确认的绩效! - + + + - style="display:none;" > - {$data['real_name']} - - - - - -
- 提交保存 -
+ style="display:none;" > + {$data['real_name']} + + + + + +
+ 提交保存 +
+ + diff --git a/Application/Admin/View/MarketPercentage/marketstaffsettle.html b/Application/Admin/View/MarketPercentage/marketstaffsettle.html index 89efdf748..1a85b6c31 100644 --- a/Application/Admin/View/MarketPercentage/marketstaffsettle.html +++ b/Application/Admin/View/MarketPercentage/marketstaffsettle.html @@ -227,7 +227,7 @@ - aOh! 暂时还没有内容! + aOh! 暂时无需要确认数据。 diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index f24f88456..8ea8ddb67 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -236,11 +236,13 @@ class PromoteService { return ['status' => false, 'msg' => '系统异常, 处理推广员平台币失败']; } */ + $levelColumn = 'level' . $toPromote['level'] . '_id'; + $subLevelColumn = 'level' . ($toPromote['level'] + 1) . '_id'; $firstMap = ['parent_id' => $fromPromote['id']]; $secondMap = ['chain' => ['like', $fromPromote['chain'] . $fromPromote['id'] . '/%']]; if (count($shiftIds) > 0) { $firstMap['id'] = ['in', $shiftIds]; - $secondMap['parent_id'] = ['in', $shiftIds]; + $secondMap[$subLevelColumn] = ['in', $shiftIds]; } try { @@ -248,12 +250,12 @@ class PromoteService { 'parent_id' => $toPromote['id'], 'parent_name' => $toPromote['account'], 'chain' => $toPromote['chain'] . $toPromote['id'] . '/', - 'level' . $toPromote['level'] => $toPromote['id'] + $levelColumn => $toPromote['id'] ]); M('promote', 'tab_')->where($secondMap)->save([ 'chain' => ['exp', 'REPLACE(chain, "/' . $fromPromote['id'] . '/","/' . $toPromote['id'] . '/")'], - 'level' . $toPromote['level'] . '_id' => $toPromote['id'] + $levelColumn => $toPromote['id'] ]); $model->commit();