mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
Fix[BE} : Fixing duplocate SO number
This commit is contained in:
@@ -70,6 +70,7 @@ func (r *MarketingRepositoryImpl) numberExists(ctx context.Context, db *gorm.DB,
|
||||
if err := db.WithContext(ctx).
|
||||
Model(&entity.Marketing{}).
|
||||
Where(fmt.Sprintf("%s = ?", column), value).
|
||||
Where("deleted_at IS NULL").
|
||||
Count(&count).Error; err != nil {
|
||||
return false, err
|
||||
}
|
||||
@@ -87,6 +88,7 @@ func (r *MarketingRepositoryImpl) generateSequentialNumber(ctx context.Context,
|
||||
err := db.WithContext(ctx).
|
||||
Model(&entity.Marketing{}).
|
||||
Where(fmt.Sprintf("%s LIKE ?", column), prefix+"%").
|
||||
Where("deleted_at IS NULL").
|
||||
Select(column).
|
||||
Order(fmt.Sprintf("%s DESC", column)).
|
||||
Limit(20).
|
||||
|
||||
Reference in New Issue
Block a user