优化列表新增市场部

master
chenzhi 3 years ago
parent 3b49a29b7a
commit 6095f3b12d

@ -3096,11 +3096,14 @@ function withMarketAdminCondition($map, $searchMarketAdminId = 0)
}
if ($adminId == 0) {
$adminId = $searchMarketAdminId > 0 ? $searchMarketAdminId : 0;
$adminId = empty($searchMarketAdminId) ? 0 : $searchMarketAdminId;
}
if($adminId == -1){
$map['promote_id'] = ['in', [$adminId]];
return $map;
}
if ($adminId) {
$topPromoteIds = M('promote', 'tab_')->where(['admin_id' => $adminId, 'level' => 1])->getField('id', true);
$topPromoteIds = M('promote', 'tab_')->where(['admin_id' => ['in',$adminId], 'level' => 1])->getField('id', true);
$promoteIds = getPromoteIdsByTopIds($topPromoteIds);
if (count($promoteIds) == 0) {
$promoteIds = [-1];

@ -83,7 +83,22 @@ class MemberController extends ThinkController
$is_repeat = true;
}
$isMarketAdmin = isMarketAdmin();
$map = withMarketAdminCondition($map, I('market_admin_id', 0));
$marketAdminIds = 0;
if(!empty($_REQUEST['market_admin_id'])){
$marketAdminIds = $_REQUEST['market_admin_id'];
}
if(!empty($_REQUEST['department_id'])){
$departmentUser = A("Market",'Event')->getDepartmentUserId($_REQUEST['department_id']);
if($marketAdminIds){
if(!in_array($marketAdminIds,$departmentUser)){
$marketAdminIds = -1;
}
}else{
$marketAdminIds = $departmentUser;
}
}
$map = withMarketAdminCondition($map, $marketAdminIds);
if (isset($_REQUEST['status'])) {
$map['lock_status'] = $_REQUEST['status'];
@ -318,6 +333,7 @@ class MemberController extends ThinkController
$this->assign('_page', $page);
}
$this->assign('list_data', $data);
$this->assign('departments', A("Market",'Event')->getDepartments());
$show_data_power = (is_administrator()|| session('user_auth')['show_data']);
$this->assign('show_data_power', $show_data_power);
$this->display();

@ -293,5 +293,10 @@ class MarketEvent extends Controller
return $this->marketDepartment[$type];
}
/**获取市场部部门 */
public function getDepartments()
{
return M('department', 'sys_')->where(['id'=>['in',$this->MarketDepartmentId]])->field("id,name")->select();
}
}

@ -166,6 +166,15 @@
</div>
<?php endif;?>
<?php if(!$isMarketAdmin && $showMarketAdmin == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="department_id" style="color:#444" class="select_gallery" id="department_id">
<option value="0">所属市场部</option>
<?php foreach($departments as $department):?>
<option value="<?=$department['id']?>" <?php if ($_POST['department_id'] == $department['id']):?>selected<?php endif;?>><?=$department['name']?></option>
<?php endforeach;?>
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="market_admin_id" style="color:#444" class="select_gallery" id="market_admin_id">
<option value="0">所属市场专员</option>
@ -174,6 +183,7 @@
<?php endforeach;?>
</select>
</div>
<?php endif;?>
<div class="input-list">
<input type="text" name="device_number" class="" placeholder="设备号" value="{:I('device_number')}"/>&nbsp;
@ -402,7 +412,7 @@
去重用户数:{$repeat_count}&#12288;&#12288;
非去重用户数:{$no_repeat_count}&#12288;&#12288;
</td>
<td colspan="8" style="font-style: 12px;color: #a9a9a9;text-align: center;">
<td colspan="10" style="font-style: 12px;color: #a9a9a9;text-align: center;">
用户累计充值:仅表示符合筛选条件下的所有用户的充值总额,因为存在换绑等原因,所以不作为推广员充值总额的依据。
</td>
</tr>

Loading…
Cancel
Save