fix: fix product upload
This commit is contained in:
parent
ad71d81b4e
commit
f5b510d75b
|
@ -84,28 +84,22 @@ export class ProductService {
|
|||
where: {
|
||||
product: productData.id,
|
||||
partner: partnerData.id,
|
||||
endDate: IsNull(),
|
||||
},
|
||||
});
|
||||
|
||||
} else {
|
||||
dataHistoryPrice = await this.productHistoryPrice.findOne({
|
||||
product: productData,
|
||||
partner: IsNull(),
|
||||
endDate: IsNull(),
|
||||
});
|
||||
}
|
||||
|
||||
if (!dataHistoryPrice) {
|
||||
await this.productHistoryPrice.insert({
|
||||
product: productData,
|
||||
mark_up_price: it[4],
|
||||
price: it[3],
|
||||
type: productType.NORMAL,
|
||||
startDate: new Date(),
|
||||
partner: it[6] != '-' ? partnerData : null,
|
||||
if (dataHistoryPrice) {
|
||||
await this.productHistoryPrice.update(dataHistoryPrice.id, {
|
||||
endDate: new Date(),
|
||||
});
|
||||
} else {
|
||||
dataHistoryPrice.endDate = new Date();
|
||||
await this.productHistoryPrice.save(dataHistoryPrice);
|
||||
}
|
||||
|
||||
await this.productHistoryPrice.insert({
|
||||
product: productData,
|
||||
|
@ -115,7 +109,6 @@ export class ProductService {
|
|||
startDate: new Date(),
|
||||
partner: it[6] != '-' ? partnerData : null,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let partnerData;
|
||||
if (it[6] != '-' && it[6] != '') {
|
||||
|
|
|
@ -1062,7 +1062,7 @@ export class TransactionService {
|
|||
'status',
|
||||
'userData.name',
|
||||
])
|
||||
.orderBy('transaction.created_at','DESC');
|
||||
.orderBy('transaction.created_at', 'DESC');
|
||||
|
||||
if (startDate && endDate) {
|
||||
baseQuery.andWhere(
|
||||
|
|
Loading…
Reference in New Issue
Block a user