WIP: разгрузка User:class от сторонних методов.
This commit is contained in:
@@ -146,4 +146,20 @@ class ItemsModel
|
||||
}
|
||||
return $rt;
|
||||
}
|
||||
|
||||
/** Выбор предмета в инвентаре.
|
||||
* @param int $itemId
|
||||
* @param int $ownerId
|
||||
* @return array
|
||||
*/
|
||||
public static function getOwnedItemById(int $itemId, int $ownerId): array
|
||||
{
|
||||
return Db::getRow('select * from items_users left join items_main on item_id = items_main.id where uid = ? and items_users.id = ? and `delete` = 0 and inOdet = 0 and inShop = 0', [$ownerId, $itemId]);
|
||||
}
|
||||
|
||||
public static function delete(int $id)
|
||||
{
|
||||
Db::sql('update items_users set `delete` = unix_timestamp() where id = ?', [$id]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user