|
|
|
@ -246,16 +246,15 @@ class User extends UserModel |
|
|
|
|
$oldGradeId = $this['grade_id']; |
|
|
|
|
return $this->transaction(function () use ($oldGradeId, $data) { |
|
|
|
|
$up = []; |
|
|
|
|
if (!empty($data['user_type']) && !empty($data['effective_time'])) { |
|
|
|
|
$data['user_type'] = intval($data['user_type']); |
|
|
|
|
if ($data['user_type'] == 30) { |
|
|
|
|
$up['fx_effective_time'] = $data['effective_time']; |
|
|
|
|
} elseif (in_array($data['user_type'], [10, 20])) { |
|
|
|
|
if (!empty($data['user_type']) && in_array(intval($data['user_type']), [40, 20, 30])) { |
|
|
|
|
if (intval($data['user_type']) == 30 && !empty($data['fx_effective_time'])) { |
|
|
|
|
$up['fx_effective_time'] = $data['fx_effective_time']; |
|
|
|
|
} elseif (intval($data['user_type']) == 40 || intval($data['user_type']) == 20) { |
|
|
|
|
$up['effective_time'] = $data['effective_time']; |
|
|
|
|
} else { |
|
|
|
|
$up['effective_time'] = null; |
|
|
|
|
$up['fx_effective_time'] = null; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$up['effective_time'] = null; |
|
|
|
|
$up['fx_effective_time'] = null; |
|
|
|
|
} |
|
|
|
|
$up['user_type'] = !empty($data['user_type']) ? $data['user_type'] : 10; |
|
|
|
|
$up['grade_id'] = $data['grade_id']; |
|
|
|
|