✨ feat(37需求): 礼包码的使用限制通过order_id判断
This commit is contained in:
@@ -63,6 +63,12 @@ export default class GiftCodeDetail extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async checkOrderHasUsed(id: number, orderId: string) {
|
||||
let result = await GiftCodeDetailModel.exists({ giftId: id, 'record.orderId': orderId });
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static async findAllCodeByGiftId(id: number, cnt: number) {
|
||||
let n = Math.ceil(cnt/1000);
|
||||
let result: GiftCodeDetailType[] = [];
|
||||
|
||||
Reference in New Issue
Block a user