Scope knowledge and image libraries by brand
This commit is contained in:
@@ -32,6 +32,7 @@ type mediaSupplySyncJob struct {
|
||||
type mediaSupplySubmitOrder struct {
|
||||
ID int64
|
||||
TenantID int64
|
||||
BrandID int64
|
||||
UserID int64
|
||||
ModelID int
|
||||
Title string
|
||||
@@ -172,7 +173,7 @@ func (w *MediaSupplyWorker) processOneOrder(ctx context.Context) error {
|
||||
if err := w.refreshOrderCostsBeforeSubmit(ctx, order, items); err != nil {
|
||||
return w.failOrder(ctx, order, err)
|
||||
}
|
||||
content, err := w.service.prepareMeijiequanArticleContent(ctx, order.TenantID, order.ContentSnapshot)
|
||||
content, err := w.service.prepareMeijiequanArticleContent(ctx, order.TenantID, order.BrandID, order.ContentSnapshot)
|
||||
if err != nil {
|
||||
return w.failOrder(ctx, order, err)
|
||||
}
|
||||
@@ -1143,7 +1144,7 @@ func (w *MediaSupplyWorker) claimSubmitOrder(ctx context.Context) (*mediaSupplyS
|
||||
var order mediaSupplySubmitOrder
|
||||
var requestPayload []byte
|
||||
if err := tx.QueryRow(ctx, `
|
||||
SELECT id, tenant_id, user_id, model_id, title, content_snapshot, remark, order_brand, attempt_count, request_payload_json
|
||||
SELECT id, tenant_id, brand_id, user_id, model_id, title, content_snapshot, remark, order_brand, attempt_count, request_payload_json
|
||||
FROM media_supply_orders
|
||||
WHERE supplier = $1 AND status = $2 AND next_attempt_at <= NOW() AND deleted_at IS NULL
|
||||
ORDER BY queued_at ASC, id ASC
|
||||
@@ -1152,6 +1153,7 @@ func (w *MediaSupplyWorker) claimSubmitOrder(ctx context.Context) (*mediaSupplyS
|
||||
`, mediaSupplySupplierMeijiequan, mediaSupplyOrderStatusQueued).Scan(
|
||||
&order.ID,
|
||||
&order.TenantID,
|
||||
&order.BrandID,
|
||||
&order.UserID,
|
||||
&order.ModelID,
|
||||
&order.Title,
|
||||
|
||||
Reference in New Issue
Block a user