Commit 992eee3b by wkliang

fix date

parent 1dc5dd2d
......@@ -4,14 +4,14 @@ const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
var moment = require('moment')
class NeedinfoService extends ServiceBase {
constructor() {
constructor () {
super("dbneed", ServiceBase.getDaoName(NeedinfoService));
this.execlient = system.getObject("util.execClient");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao");
this.needinfoDao = system.getObject("db.dbneed.needinfoDao");
}
async getItemByNeedNo(pobj) {
async getItemByNeedNo (pobj) {
var item = await this.dao.getItemByNeedNo(pobj.actionBody.needNo);
console.log(system.getResultSuccess(item));
if (!item) {
......@@ -20,7 +20,7 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(item);
}
async opSubmitNeed(pobj, actionBody, req) {
async opSubmitNeed (pobj, actionBody, req) {
var needNo = await this.getBusUid("n");
if (!actionBody.mobile) {
return system.getResultFail(-5002, "mobile不能为空");
......@@ -47,7 +47,7 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(r);
}
async opNeedList(pobj, actionBody, req) {
async opNeedList (pobj, actionBody, req) {
// 时间段,分页,排序,需求状态 条件展示未做
console.log(pobj);
console.log(pobj.actionBody);
......@@ -76,15 +76,15 @@ class NeedinfoService extends ServiceBase {
if (actionBody.publishMobile) {
sobj.search.publishMobile = actionBody.publishMobile
}
if (actionBody.updatedAt) {
sobj.search.updated_at = actionBody.updatedAt
if (actionBody.stdate && actionBody.endate) {
sobj.search.updated_at = { [this.db.Op.between]: [actionBody.stdate, actionBody.endate] }
}
var r = await this.dao.findAndCountAll(sobj);
return system.getResultSuccess(r);
}
async opNeedListBak(pobj, actionBody, req) {
let statusDic = ['wts','yts','ygj','ygb','ycd']
async opNeedListBak (pobj, actionBody, req) {
let statusDic = ['wts', 'yts', 'ygj', 'ygb', 'ycd']
var sobj = {
search: {
},
......@@ -111,14 +111,14 @@ class NeedinfoService extends ServiceBase {
if (actionBody.publishMobile) {
sobj.search.publishMobile = actionBody.publishMobile
}
if (actionBody.updatedAt) {
sobj.search.updated_at = actionBody.updatedAt
if (actionBody.stdate && actionBody.endate) {
sobj.search.updated_at = { [this.db.Op.between]: [actionBody.stdate, actionBody.endate] }
}
var r = await this.dao.findAndCountAll(sobj);
return system.getResultSuccess(r);
}
async opNeedClose(pobj, actionBody, req) {
async opNeedClose (pobj, actionBody, req) {
var needinfo = await this.findOne({ channelNeedNo: actionBody.needNo });
if (!needinfo) {
return system.getResultFail(-5004, "需求不存在");
......
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