12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- --[[
- Descripttion:商城配置
- version:
- Author: Neo,Huang
- Date: 2022-08-19 17:36:25
- LastEditors: Neo,Huang
- LastEditTime: 2022-08-31 20:25:35
- --]]
- local baseAdapt = require "base.baseAdapt"
- local root = {}
- -- 商品信息
- function root:goods_get_info(gid)
- if gid == nil then
- return
- end
- local shConf = baseAdapt:getConfig("GoodsConfig")
- for k, v in ipairs(shConf) do
- if v.id == gid then
- return v
- end
- end
- end
- -- 获取商品价格
- function root:goods_get_rmb(gid)
- local conf = self:goods_get_info(gid)
- if conf and conf.rmb then
- return conf.rmb
- end
- return 0
- end
- -- 商品物品
- function root:goods_get_items(gid)
- local conf = self:goods_get_info(gid)
- if conf and not is_empty(conf.items) then
- return table.copy(conf.items)
- end
- end
- return root
|