wang hou sheng 7 months ago
parent 71c430d639
commit 6ef632e489
  1. 15
      app/store/model/User.php

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

Loading…
Cancel
Save