updates table schema
This commit is contained in:
@@ -23,18 +23,14 @@ impl Player {
|
||||
Ok(players.load::<Self>(conn)?)
|
||||
}
|
||||
|
||||
pub fn fetch_chest(player: i32, conn: &SqliteConnection) -> QueryResult<Vec<Item>> {
|
||||
let owned = {
|
||||
use schema::looted::dsl::*;
|
||||
looted.filter(player_id.eq(player)).select(item_id).load::<i32>(conn)?
|
||||
};
|
||||
pub fn fetch_chest(player_id: i32, conn: &SqliteConnection) -> QueryResult<Vec<Item>> {
|
||||
use schema::looted::dsl::*;
|
||||
let owned = looted
|
||||
.filter(owner_id.eq(player_id))
|
||||
.select((id, name, base_price))
|
||||
.load::<Item>(conn)?;
|
||||
dbg!(&owned);
|
||||
let chest = {
|
||||
use schema::items::dsl::*;
|
||||
items.filter(id.eq_any(owned)).load::<Item>(conn)?
|
||||
};
|
||||
dbg!(&chest);
|
||||
Ok(chest)
|
||||
Ok(owned)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user