Commit f24d22a0 authored by qinhaitao's avatar qinhaitao

fix: 🐛 更新useStock问题

parent a25d0594
......@@ -258,7 +258,10 @@ var BaseController = /** @class */ (function () {
v.name || '',
v.type == 1 ? '/' : v.receiveName || '',
v.type == 1 ? '/' : v.phone || '未填',
v.type == 1 ? '/' : v.province ? v.province + v.city + v.area + v.addressdetail : '未填',
v.type == 1 ? '/' : v.province ? v.province : '未填',
v.type == 1 ? '/' : v.city ? v.city : '未填',
v.type == 1 ? '/' : v.area ? v.area : '未填',
v.type == 1 ? '/' : v.addressdetail ? v.addressdetail : '未填',
v.type == 1 ? '/' : shipMsg[v.shipStatus],
v.type == 1 ? '/' : v.shipCompany || '/',
v.type == 1 ? '/' : v.shipNum || '/'
......@@ -346,8 +349,8 @@ var BaseController = /** @class */ (function () {
awardslist.map(function (item) {
var ad = item.province + item.city + item.area + item.addressdetail, type0 = item.type;
item.prizeId = item._id;
item.createTime = utils_1.formatTime(new Date(item.createTime)) || '';
item.receiveTime = item.receiveTime ? utils_1.formatTime(new Date(item.receiveTime)) : '未填';
item.createTime = utils_1.formatTime(new Date(item.createTime + constants_1.EIGHT_HOURS)) || '';
item.receiveTime = item.receiveTime ? utils_1.formatTime(new Date(item.receiveTime + constants_1.EIGHT_HOURS)) : '未填';
item.prizeDataType = prizePoolType[item.prizeDataType];
item.type = prizeKind[item.type];
item.receiveName = type0 == 3 ? item.receiveName || '未填' : '/';
......
......@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
/** @format */
......
......@@ -12,7 +12,7 @@ export default class ActivityConfigService {
success: any[];
failed: any[];
}>;
updateOnePrizeById(id: any, data: any): Promise<any>;
updateOnePrizeById(id: any, data: IActivityPrize): Promise<any>;
insertPrizeByActivityId(activityId: any, data: any): Promise<any>;
getAllOldPrizeList(activityId: string): Promise<any>;
diffPrizeList(activityId: string, pirzeList: Array<IActivityPrize>): Promise<{
......
......@@ -237,11 +237,22 @@ var ActivityConfigService = /** @class */ (function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityconfigPrizeDao.update({
_id: id
}, {
$set: __assign(__assign({}, data), { updateTime: Date.now(), deleteStatus: constants_1.DELETE_STATUS.EXIST })
})];
case 0:
if (data.switchStock === constants_1.STOCK_TYPE.NO_LIMIT) {
data.useStock = 0;
}
else {
delete data.useStock;
}
return [4 /*yield*/, this.activityconfigPrizeDao.update({
_id: id
}, {
$set: {
data: data,
updateTime: Date.now(),
deleteStatus: constants_1.DELETE_STATUS.EXIST
}
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
......
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.AwardsService = exports.InstanceService = exports.SellerService = exports.TaobaoTopService = exports.ActivityconfigService = void 0;
var activityconfig_service_1 = require("./activityconfig.service");
Object.defineProperty(exports, "ActivityconfigService", { enumerable: true, get: function () { return activityconfig_service_1.default; } });
var taobaoTop_service_1 = require("./taobaoTop.service");
......
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":";AAAA,cAAc;;AAEd,mEAA2E;AAAlE,+HAAA,OAAO,OAAyB;AACzC,yDAAiE;AAAxD,qHAAA,OAAO,OAAoB;AACpC,mDAA2D;AAAlD,+GAAA,OAAO,OAAiB;AACjC,uDAA+D;AAAtD,mHAAA,OAAO,OAAmB;AACnC,mDAA2D;AAAlD,+GAAA,OAAO,OAAiB"}
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,mEAA2E;AAAlE,+HAAA,OAAO,OAAyB;AACzC,yDAAiE;AAAxD,qHAAA,OAAO,OAAoB;AACpC,mDAA2D;AAAlD,+GAAA,OAAO,OAAiB;AACjC,uDAA+D;AAAtD,mHAAA,OAAO,OAAmB;AACnC,mDAA2D;AAAlD,+GAAA,OAAO,OAAiB"}
\ No newline at end of file
......@@ -8,7 +8,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./logger"), exports);
......
......@@ -136,15 +136,20 @@ export default class ActivityConfigService {
}
// 更新单条数据
async updateOnePrizeById(id, data) {
const { useStock, ...rest } = data;
async updateOnePrizeById(id, data: IActivityPrize) {
if(data.switchStock === STOCK_TYPE.NO_LIMIT) {
data.useStock = 0
} else {
delete data.useStock
}
return await this.activityconfigPrizeDao.update(
{
_id: id
},
{
$set: {
...rest,
data,
updateTime: Date.now(),
deleteStatus: DELETE_STATUS.EXIST
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment