diff --git a/src/api_s2c/kuangdong/ApiYanShi.ts b/src/api_s2c/kuangdong/ApiYanShi.ts index 16a8736..ac0be05 100644 --- a/src/api_s2c/kuangdong/ApiYanShi.ts +++ b/src/api_s2c/kuangdong/ApiYanShi.ts @@ -14,7 +14,7 @@ export default async function (call: ApiCall) { kdInfo = await KuangDongfun.getKaiCaiInfo(hdid, call.uid) } - if (!kdInfo) { + if (!kdInfo || !con) { return call.error('', {code: -1, message: globalThis.lng.kudangdong_1}) } @@ -37,12 +37,15 @@ export default async function (call: ApiCall) { _need && await PlayerFun.cutNeed(call, _need); kdInfo.yanshi = 8 * 3600 + if (!kdInfo.ctime) kdInfo.ctime = G.time + if (!kdInfo.etime) kdInfo.etime = G.time + if (!kdInfo.kdtype) kdInfo.kdtype = con.type // 如果调用这个方法,会upsert,在没有查到数据的情况下, // 会插入空数据,全服玩家的查询列表接口都会报错 // await KuangDongfun.setminingZhanLing(call.uid, hdid, { $set: { yanshi: kdInfo.yanshi } }) await G.mongodb.collection('kuangdong').updateOne({uid: call.uid, hdid: hdid}, - {$set: {yanshi: kdInfo.yanshi}}); + {$set: kdInfo}); kdInfo._id = kdInfo._id.toString() let changeData = {