mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix getByIdAndRssToken function
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2018-02-02 DariusIII
|
||||
* Fix: Fix getByIdAndRssToken function
|
||||
* Chg: Use replace getById user lookup with User model find built in function(does the same thing as custom function)
|
||||
2018-02-01 DariusIII
|
||||
* Chg: Update sebastian/comparator to latest version
|
||||
|
||||
+2
-18
@@ -529,28 +529,12 @@ class User extends Authenticatable
|
||||
*/
|
||||
public static function getByIdAndRssToken($userID, $rssToken)
|
||||
{
|
||||
$user = self::query()->where('id', '=', $userID, true)->where('rsstoken', '=', $rssToken)->get();
|
||||
$user = self::query()->where(['id' => $userID, 'rsstoken' => $rssToken])->first();
|
||||
if ($user === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
*
|
||||
* @return array|bool
|
||||
*/
|
||||
public static function getById($id)
|
||||
{
|
||||
$result = self::find($id);
|
||||
|
||||
if ($result === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $result;
|
||||
return $user->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user