Commit a6bef0a58f14c58f6077738231cd4824a65a11c7

Authored by Deepseath
1 parent c503ff97

离职、删除 成员后 hris 变更后的邮箱回传

Showing 1 changed file with 6 additions and 2 deletions
src/ApiV2/User.php
... ... @@ -107,9 +107,10 @@ class User
107 107 /**
108 108 * 员工离职
109 109 * @param array $params
  110 + * @param string $newEmail &离职后的 hris 成员邮箱
110 111 * @return mixed
111 112 */
112   - public function dismiss(array $params) : mixed
  113 + public function dismiss(array $params, &$newEmail = '') : mixed
113 114 {
114 115 if (!empty($params['email']) && preg_match('/@i\-click\.com$/is', $params['email'])) {
115 116 // 如果是 i-click.com 邮箱则不处理
... ... @@ -126,6 +127,7 @@ class User
126 127 } else {
127 128 $params['email'] = $params['email'] . '_' . 'dismiss_'.date('Ymd') .'_' . mt_rand(100000, 999999);
128 129 }
  130 + $newEmail = $params['email'];
129 131 $emailParams['updateEmail'] = $params['email'];
130 132 $this->email($emailParams);
131 133 }
... ... @@ -139,9 +141,10 @@ class User
139 141 /**
140 142 * 删除成员
141 143 * @param array $params
  144 + * @param string $newEmail &删除后 hris 成员的邮箱
142 145 * @return mixed
143 146 */
144   - public function delete(array $params) : mixed
  147 + public function delete(array $params, &$newEmail = '') : mixed
145 148 {
146 149 if (!empty($params['email']) && preg_match('/@i\-click\.com$/is', $params['email'])) {
147 150 // 如果是 i-click.com 邮箱则不处理
... ... @@ -158,6 +161,7 @@ class User
158 161 } else {
159 162 $params['email'] = $params['email'] . '_' . 'delete_'.date('Ymd') .'_' . mt_rand(100000, 999999);
160 163 }
  164 + $newEmail = $params['email'];
161 165 $emailParams['updateEmail'] = $params['email'];
162 166  
163 167 $this->email($emailParams);
... ...