Merge branch 'feature/promote_company_merge' of wmtx/platform into release

修改功能
master
万盟天下 4 years ago committed by Gogs
commit 25c06c4b2d

@ -387,6 +387,15 @@ class UserController extends AdminController
$this->error('该手机号码已经添加过!'); $this->error('该手机号码已经添加过!');
} }
} }
$group = M('auth_group', 'sys_')->where(['id' => I('auth')])->find();
if (is_null($group)) {
$this->error('角色类型不存在!');
} else {
if (!IS_ROOT && strpos($group['title'], '市场专员') !== false && !isMarketLeader()) {
$this->error('市场专员编辑仅允许市场总监操作!');
}
}
// if (isset($_POST['mobile']) && $_POST['mobile'] != '') { // if (isset($_POST['mobile']) && $_POST['mobile'] != '') {
// $dx = A('Phone'); // $dx = A('Phone');
// $res = $dx->check_tel_code($_POST['mobile'], $_POST['code']); // $res = $dx->check_tel_code($_POST['mobile'], $_POST['code']);

@ -281,12 +281,17 @@ class PromoteCompanyService
private function savePromotes($records, $company, $creator) private function savePromotes($records, $company, $creator)
{ {
$status = 1;
/* if (C('PROMOTE_AUTO_AUDIT') == 1) {
$status = 1;
} */
$promoteService = new PromoteService(); $promoteService = new PromoteService();
foreach ($records as $record) { foreach ($records as $record) {
$promoteService->addPromote([ $promoteService->addPromote([
'account' => $record['account'], 'account' => $record['account'],
'password' => $record['password'], 'password' => $record['password'],
'real_name' => $record['real_name'], 'real_name' => $record['real_name'],
'status' => $status,
'email' => $record['email'], 'email' => $record['email'],
'mobile_phone' => $record['mobile_phone'], 'mobile_phone' => $record['mobile_phone'],
'can_view_recharge' => $record['can_view_recharge'], 'can_view_recharge' => $record['can_view_recharge'],

@ -391,6 +391,19 @@ class BaseController extends HomeController
if ($permission == 'view-user-recharge') { if ($permission == 'view-user-recharge') {
$promoteService = new PromoteService(); $promoteService = new PromoteService();
$topPromote = $promoteService->getTopPromote($promote); $topPromote = $promoteService->getTopPromote($promote);
/**
* 市场部特殊推广公司的规则
*/
$onlyPresidentList = [330, 331, 332];
if (in_array($topPromote['company_id'], $onlyPresidentList)) {
if ($topPromote['can_view_recharge'] == 1 && $promote['level'] == 1) {
return true;
} else {
return false;
}
}
if ($topPromote['can_view_recharge'] == 1) { if ($topPromote['can_view_recharge'] == 1) {
return true; return true;
} }

Loading…
Cancel
Save