// 创建销售标签 func (this *labelManagerImpl) CreateSaleLabel(v *sale.Label) sale.ISaleLabel { if v == nil { return nil } v.MerchantId = this._mchId return this._rep.CreateSaleLabel(v) }
// 保存销售标签 func (this *saleLabelRep) SaveSaleLabel(merchantId int, v *sale.Label) (int, error) { orm := this.GetOrm() var err error v.MerchantId = merchantId if v.Id > 0 { _, _, err = orm.Save(v.Id, v) } else { _, _, err = orm.Save(nil, v) this.Connector.ExecScalar("SELECT MAX(id) FROM gs_sale_label WHERE mch_id=?", &v.Id, merchantId) } return v.Id, err }