diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 615c3529b..13d73fb09 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']) { @@ -789,6 +833,16 @@ class MarketPercentageController extends ThinkController $map = []; + $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['pay_time']?$map['pay_time'] = $_REQUEST['pay_time']:''; $_REQUEST['real_name']?$map['real_name'] = $_REQUEST['real_name']:''; $_REQUEST['nickname']?$map['nickname'] = $_REQUEST['nickname']:''; diff --git a/Application/Admin/View/MarketPercentage/marketstaffsettle.html b/Application/Admin/View/MarketPercentage/marketstaffsettle.html index c8f53cae9..c5b39f591 100644 --- a/Application/Admin/View/MarketPercentage/marketstaffsettle.html +++ b/Application/Admin/View/MarketPercentage/marketstaffsettle.html @@ -134,7 +134,7 @@