✨ feat(37需求): 礼包码的使用限制通过order_id判断
This commit is contained in:
@@ -799,4 +799,5 @@ export const SDK_37_ACTIVITY_CODE = {
|
||||
GIFT_CHANNEL_ERR: { code: 20007, simStr: '礼包不可在此渠道使用' },
|
||||
TIME_IS_EXPIRED: { code: 20008, simStr: '时间戳已过期' },
|
||||
SERVER_NOT_FOUND: { code: 20009, simStr: '服务器未找到' },
|
||||
GIFT_CODE_CANNOT_USE: { code: 20010, simStr: '该礼包码不可使用' },
|
||||
}
|
||||
@@ -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