优化代码

main
home.fengxinyhyl 8 months ago
parent fd5f112ea9
commit ebd00fc8e7
  1. 28
      app/common/repositories/user/UserAssetsRepository.php
  2. 1
      app/common/repositories/user/UserRepository.php
  3. 1
      app/controller/api/Auth.php

@ -60,19 +60,23 @@ class UserAssetsRepository extends BaseRepository
$item = $this->dao->get($uid);
if ($item) {
return $item->toArray();
}else{
$ret = array(
'uid' => $uid,
'consume' => 0.00,
'consume_frozen' => 0.00,
'share_point' => 0.00,
'welfare' => 0.00,
'welfare_frozen' => 0.00,
'huitong' => 0.00,
'huitong_frozen' => 0.00,
'contribution' => 0.00,
'contribution_frozen' => 0.00,
);
$this->dao->create($ret);
return $ret;
}
return array(
'uid' => 0,
'consume' => 0.00,
'consume_frozen' => 0.00,
'share_point' => 0.00,
'welfare' => 0.00,
'welfare_frozen' => 0.00,
'huitong' => 0.00,
'huitong_frozen' => 0.00,
'contribution' => 0.00,
'contribution_frozen' => 0.00,
);
}

@ -550,6 +550,7 @@ class UserRepository extends BaseRepository
'last_time' => date('Y-m-d H:i:s'),
'last_ip' => $request->ip()
]);
app(UserAssetsRepository::class)->assets($user['uid']);
}
return $user;
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save