You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
596 B
Lua
23 lines
596 B
Lua
local customprice = {}
|
|
|
|
customprice.setdb = function(db)
|
|
customprice.db = db
|
|
end
|
|
|
|
customprice.find = function(item_record, user_record, db)
|
|
return customprice.db:findByStructure({type='custom_price', item_id=item_record.id, user_id=user_record_id})[1]
|
|
end
|
|
|
|
customprice.new = function(t, db)
|
|
local customprice_record = {}
|
|
customprice_record.type = 'custom_price'
|
|
customprice_record.user_id = t.user.id
|
|
customprice_record.item_id = t.item.id
|
|
customprice_record.price = t.price
|
|
|
|
customprice.db:insertrecord(customprice_record)
|
|
|
|
return customprice_record
|
|
end
|
|
|
|
return customprice |