Commit c2f27471 by 宋毅

tj

parent 1c29c073
......@@ -209,27 +209,47 @@ class OrderInfoService extends ServiceBase {
var pageIndex = Number(actionBody.pageIndex || 1);
var from = pageIndex == 1 ? 0 : Number((pageIndex - 1) * pageSize);
var sql = "select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`,`invoiceApplyStatus`,`opNotes`,`channelItemCode`,`channelItemName`,`serviceItemCode`,`picUrl`"
+ " from v_order where uapp_id=" + pobj.appInfo.uapp_id + " and channelUserId=" + pobj.userInfo.channel_userid;
var sqlCount = "select count(1) as dataCount from v_order where uapp_id=" + pobj.appInfo.uapp_id + " and channelUserId=" + pobj.userInfo.channel_userid;
var paramWhere = {};
var sql = "select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`,"
+ " `invoiceApplyStatus`,`opNotes`,`channelItemCode`,`channelItemName`,`serviceItemCode`,`picUrl`,created_at from v_order where uapp_id=:uapp_id";
var sqlCount = "select count(1) as dataCount from v_order where uapp_id=:uapp_id";
paramWhere.uapp_id = pobj.appInfo.uapp_id;
if (pobj.userInfo.channel_userid) {
sql += " and channelUserId=:channelUserId";
sqlCount += " and channelUserId=:channelUserId";
paramWhere.channelUserId = pobj.userInfo.channel_userid;
}
if (actionBody.channelItemName) {
sql += " and channelItemName like '%" + actionBody.channelItemName + "%'";
sqlCount += " and channelItemName like '%" + actionBody.channelItemName + "%'";
sql += " and channelItemName like :channelItemName";
sqlCount += " and channelItemName like :channelItemName";
paramWhere.channelItemName = "%" + params.channelItemName.trim() + "%";
}
if (actionBody.channelServiceNo) {
sql += " and channelServiceNo like '%" + actionBody.channelServiceNo + "%'";
sqlCount += " and channelServiceNo like '%" + actionBody.channelServiceNo + "%'";
sql += " and channelServiceNo like :channelServiceNo";
sqlCount += " and channelServiceNo like :channelServiceNo";
paramWhere.channelServiceNo = "%" + actionBody.channelServiceNo.trim() + "%";
}
if (actionBody.orderStatus) {
sql += " and orderStatus ='" + actionBody.orderStatus + "'";
sqlCount += " and orderStatus ='" + actionBody.orderStatus + "'";
sql += " and orderStatus=:orderStatus";
sqlCount += " and orderStatus=:orderStatus";
paramWhere.orderStatus = actionBody.orderStatus;
}
if (params.startTime && params.entTime) {
var startTime = actionBody.startTime.trim() + " 00:00:00";
var entTime = actionBody.entTime + " 23:59:59";
sql += " and created_at >=:startTime and created_at<=:entTime";
sqlCount += " and created_at >=:startTime and created_at<=:entTime";
paramWhere.startTime = startTime;
paramWhere.entTime = entTime;
}
sql += " LIMIT " + pageSize + " OFFSET " + from;
var list = await this.customQuery(sql);
var list = await this.customQuery(sql, paramWhere);
var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(sqlCount);
var tmpResultCount = await this.customQuery(sqlCount, paramWhere);
result.dataCount = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
......
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