From 96f68c4f500aee66d1d53867d76a505afcfd56c0 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 8 Jul 2020 09:24:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E4=B8=93=E5=91=98=E7=AD=9B?= =?UTF-8?q?=E9=80=89=EF=BC=8C=E6=9C=88=E4=BB=BD=E8=B7=B3=E8=BD=AC=EF=BC=8C?= =?UTF-8?q?=E5=8F=8A=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarketPercentageController.class.php | 50 +++++++++++++++++-- .../MarketPercentage/marketstaffsettle.html | 2 +- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 615c3529b..070f0ee21 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -24,6 +24,15 @@ class MarketPercentageController extends ThinkController $map['admin_id'] = $admin_id; if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) { unset($map['admin_id']); + $admin_data = M("member") + ->field("access.uid admin_id") + ->join("left join sys_auth_group_access access on sys_member.uid = access.uid") + ->join("left join sys_auth_group auth on access.group_id=auth.id") + ->where(['group_id'=>['in','11,12,21']]) + ->select(); + if ($admin_data) { + $map['admin_id'] = ['in',array_column($admin_data,'admin_id')]; + } $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; } @@ -52,7 +61,7 @@ class MarketPercentageController extends ThinkController $date = date('Y-m', strtotime($start . ' + ' . $i . ' month')); $search_date[] = $date; $i++; - }while ($date < date('Y-m', strtotime("{$end} -1 month"))); + }while ($date < date('Y-m', strtotime("{$end}"))); if ($search_date) { $map['pay_time'] = ['in', $search_date]; @@ -67,13 +76,13 @@ class MarketPercentageController extends ThinkController $date = date('Y-m', strtotime($start . ' + ' . $i . ' month')); $search_date[] = $date; $i++; - }while ($date < date('Y-m', strtotime("{$end} -1 month"))); + }while ($date < date('Y-m', strtotime("{$end}"))); if ($search_date) { $map['pay_time'] = ['in', $search_date]; } } - +// dump($map);die(); // var_dump($map);die(); $data = M("settleup_marketorder","tab_") @@ -186,14 +195,27 @@ class MarketPercentageController extends ThinkController $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; $_REQUEST['group_id']?($map['level'] = $_REQUEST['group_id']):''; + $admin_id = $_SESSION['onethink_admin']['user_auth']['uid']; $map['admin_id'] = $admin_id; if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) { unset($map['admin_id']); + + $admin_data = M("member") + ->field("access.uid admin_id") + ->join("left join sys_auth_group_access access on sys_member.uid = access.uid") + ->join("left join sys_auth_group auth on access.group_id=auth.id") + ->where(['group_id'=>['in','11,12,21']]) + ->select(); + if ($admin_data) { + $map['admin_id'] = ['in',array_column($admin_data,'admin_id')]; + } + $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; } + $search_date = []; if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { @@ -507,6 +529,17 @@ class MarketPercentageController extends ThinkController $map['admin_id'] = $admin_id; if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) { unset($map['admin_id']); + + $admin_data = M("member") + ->field("access.uid admin_id") + ->join("left join sys_auth_group_access access on sys_member.uid = access.uid") + ->join("left join sys_auth_group auth on access.group_id=auth.id") + ->where(['group_id'=>['in','11,12,21']]) + ->select(); + if ($admin_data) { + $map['admin_id'] = ['in',array_column($admin_data,'admin_id')]; + } + $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; } @@ -675,6 +708,17 @@ class MarketPercentageController extends ThinkController public function sendBonus() { $map['pay_time'] = $_REQUEST['pay_time']; + + $admin_data = M("member") + ->field("access.uid admin_id") + ->join("left join sys_auth_group_access access on sys_member.uid = access.uid") + ->join("left join sys_auth_group auth on access.group_id=auth.id") + ->where(['group_id'=>['in','11,12,21']]) + ->select(); + if ($admin_data) { + $map['admin_id'] = ['in',array_column($admin_data,'admin_id')]; + } + $map['admin_id'] = $_REQUEST['admin_id']; if (!$_REQUEST['pay_time']||!$_REQUEST['admin_id']) { diff --git a/Application/Admin/View/MarketPercentage/marketstaffsettle.html b/Application/Admin/View/MarketPercentage/marketstaffsettle.html index c8f53cae9..f35167965 100644 --- a/Application/Admin/View/MarketPercentage/marketstaffsettle.html +++ b/Application/Admin/View/MarketPercentage/marketstaffsettle.html @@ -134,7 +134,7 @@ {$data['achievement_bonus']|default='0.00'} {$data['commission']|default='0.00'} {$data['extend_commission']|default='0.00'} - {$data['wait_commission']|default='0.00'} + {$data['wait_commission']|default='0.00'} 合计