func (this *ItemImpl) SetValue(v *item.Item) error { if v.Id == this._value.Id { v.CreateTime = this._value.CreateTime v.GoodsNo = this._value.GoodsNo this._value = v } this._value.UpdateTime = time.Now().Unix() return nil }
func (this *itemManagerImpl) CreateItem(v *item.Item) sale.IItem { if v.CreateTime == 0 { v.CreateTime = time.Now().Unix() } if v.UpdateTime == 0 { v.UpdateTime = v.CreateTime } //todo: 判断category return newItem(this, this._sale, v, this._itemRep, this._sale._saleRep, this._sale._labelRep, this._sale._goodsRep, this._sale._promRep) }