func (this *Item) SetValue(v *sale.ValueItem) 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 *Sale) CreateItem(v *sale.ValueItem) sale.IItem { if v.CreateTime == 0 { v.CreateTime = time.Now().Unix() } if v.UpdateTime == 0 { v.UpdateTime = v.CreateTime } //todo: 判断category return newItem(this, v, this._saleRep, this._saleTagRep, this._goodsRep, this._promRep) }