fix apply ower detail
This commit is contained in:
parent
c2f6adf3fd
commit
7aff1a022d
@ -96,7 +96,8 @@ async function accessMethod(params: AccessParams, entranceInfo: EjyyIotEntrance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (reuslt.type === VISTOR_ACCESS_CODE) {
|
if (reuslt.type === VISTOR_ACCESS_CODE) {
|
||||||
const vistorInfo = await model.from('ejyy_vistor')
|
const vistorInfo = await model
|
||||||
|
.from('ejyy_vistor')
|
||||||
.where('id', reuslt.id)
|
.where('id', reuslt.id)
|
||||||
.first();
|
.first();
|
||||||
|
|
||||||
|
@ -64,7 +64,11 @@ const MpVistorCreateAction = <Action>{
|
|||||||
{
|
{
|
||||||
name: 'expire',
|
name: 'expire',
|
||||||
regex: /^\d{13}$/,
|
regex: /^\d{13}$/,
|
||||||
validator: val => Date.now() < moment(val).endOf('day').valueOf(),
|
validator: val =>
|
||||||
|
Date.now() <
|
||||||
|
moment(val)
|
||||||
|
.endOf('day')
|
||||||
|
.valueOf(),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
import { Action } from '~/types/action';
|
import { Action } from '~/types/action';
|
||||||
import { SUCCESS, QUERY_ILLEFAL } from '~/constant/code';
|
import { SUCCESS, QUERY_ILLEFAL } from '~/constant/code';
|
||||||
|
import { FALSE } from '~/constant/status';
|
||||||
import * as ROLE from '~/constant/role_access';
|
import * as ROLE from '~/constant/role_access';
|
||||||
|
|
||||||
interface RequestBody {
|
interface RequestBody {
|
||||||
@ -96,10 +97,19 @@ const PcOwerDetailAction = <Action>{
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (buildings.length === 0) {
|
if (buildings.length === 0) {
|
||||||
return (ctx.body = {
|
const existApply = await ctx.model
|
||||||
code: QUERY_ILLEFAL,
|
.from('ejyy_ower_apply')
|
||||||
message: '非法获取用户信息'
|
.where('community_id', community_id)
|
||||||
});
|
.andWhere('wechat_mp_user_id', id)
|
||||||
|
.andWhere('success', FALSE)
|
||||||
|
.first();
|
||||||
|
|
||||||
|
if (!existApply) {
|
||||||
|
return (ctx.body = {
|
||||||
|
code: QUERY_ILLEFAL,
|
||||||
|
message: '非法获取用户信息'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cars = await ctx.model
|
const cars = await ctx.model
|
||||||
|
Loading…
x
Reference in New Issue
Block a user