优化代码

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

@ -60,9 +60,9 @@ class UserAssetsRepository extends BaseRepository
$item = $this->dao->get($uid);
if ($item) {
return $item->toArray();
}
return array(
'uid' => 0,
}else{
$ret = array(
'uid' => $uid,
'consume' => 0.00,
'consume_frozen' => 0.00,
'share_point' => 0.00,
@ -73,6 +73,10 @@ class UserAssetsRepository extends BaseRepository
'contribution' => 0.00,
'contribution_frozen' => 0.00,
);
$this->dao->create($ret);
return $ret;
}
}

@ -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