Merge branch 'hotfix/market_percentage' of wmtx/platform into master

市场专员筛选,月份跳转,及时间筛选修正
master
廖金灵 4 years ago committed by Gogs
commit 80648858db

@ -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']:'';

@ -134,7 +134,7 @@
<td>{$data['achievement_bonus']|default='0.00'}</td>
<td>{$data['commission']|default='0.00'}</td>
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$data['start_time'],'time_end'=>$data['end_time'],'admin_id'=>$data['admin_id']))}" >{$data['extend_commission']|default='0.00'}</a></td>
<td><a href="{:U('MarketPercentage/showBonusList',array('pay_time'=>$data['pay_time'],'real_name'=>$data['real_name'],'level'=>$data['group_id']))}" >{$data['wait_commission']|default='0.00'}</a></td>
<td><a href="{:U('MarketPercentage/showBonusList',array('time_start'=>$data['start_time'],'time_end'=>$data['end_time'],'real_name'=>$data['real_name'],'level'=>$data['group_id']))}" >{$data['wait_commission']|default='0.00'}</a></td>
</tr>
</volist>
<td colspan="3">合计</td>
@ -143,7 +143,7 @@
<td>{$sum['performance_commission']|default='0.00'}</td>
<td>{$sum['achievement_bonus']|default='0.00'}</td>
<td>{$sum['commission']|default='0.00'}</td>
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('pay_time'=>$data['pay_time']))}" >{$sum['extend_commission']|default='0.00'}</a></td>
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$start_time,'time_end'=>$end_time))}" >{$sum['extend_commission']|default='0.00'}</a></td>
<td></td>
</notemtpy>
</tbody>

Loading…
Cancel
Save