Commit 7950542f by 宋毅

tj

parent def1ad05
...@@ -9,6 +9,11 @@ class Dao { ...@@ -9,6 +9,11 @@ class Dao {
preCreate(u) { preCreate(u) {
return u; return u;
} }
/**
*
* @param {*} u 对象
* @param {*} t 事务对象t
*/
async create(u, t) { async create(u, t) {
var u2 = this.preCreate(u); var u2 = this.preCreate(u);
if (t) { if (t) {
...@@ -64,7 +69,7 @@ class Dao { ...@@ -64,7 +69,7 @@ class Dao {
//return {"key":"include","value":{model:this.db.models.app}}; //return {"key":"include","value":{model:this.db.models.app}};
return [["created_at", "DESC"]]; return [["created_at", "DESC"]];
} }
buildAttributes(){ buildAttributes() {
return []; return [];
} }
buildQuery(qobj) { buildQuery(qobj) {
...@@ -127,8 +132,8 @@ class Dao { ...@@ -127,8 +132,8 @@ class Dao {
qc[extraFilter.key] = extraFilter.value; qc[extraFilter.key] = extraFilter.value;
} }
var attributesObj = this.buildAttributes(); var attributesObj = this.buildAttributes();
if(attributesObj && attributesObj.length>0){ if (attributesObj && attributesObj.length > 0) {
qc.attributes=attributesObj; qc.attributes = attributesObj;
} }
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"); console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm");
console.log(qc); console.log(qc);
......
...@@ -6,6 +6,7 @@ class OrderService extends ServiceBase { ...@@ -6,6 +6,7 @@ class OrderService extends ServiceBase {
constructor() { constructor() {
super("dborder", ServiceBase.getDaoName(OrderService)); super("dborder", ServiceBase.getDaoName(OrderService));
this.logCtl = system.getObject("web.common.oplogCtl"); this.logCtl = system.getObject("web.common.oplogCtl");
this.orderflowDao = system.getObject("db.dbapp.orderflowDao");
this.appproductDao = system.getObject("db.dbapp.appproductDao"); this.appproductDao = system.getObject("db.dbapp.appproductDao");
this.ordertmproductDao = system.getObject("db.dborder.ordertmproductDao"); this.ordertmproductDao = system.getObject("db.dborder.ordertmproductDao");
this.receiptvoucherDao = system.getObject("db.dborder.receiptvoucherDao"); this.receiptvoucherDao = system.getObject("db.dborder.receiptvoucherDao");
...@@ -135,6 +136,8 @@ class OrderService extends ServiceBase { ...@@ -135,6 +136,8 @@ class OrderService extends ServiceBase {
return await this.db.transaction(async function (t) { return await this.db.transaction(async function (t) {
await self.dao.updateByWhere({ orderPayStatus: payStatus, buyerMoblie: action_body.buyerMoblie || "" }, { where: { needNoOrderNo: action_body.needNoOrderNo, app_id: req.app.id } }, t); await self.dao.updateByWhere({ orderPayStatus: payStatus, buyerMoblie: action_body.buyerMoblie || "" }, { where: { needNoOrderNo: action_body.needNoOrderNo, app_id: req.app.id } }, t);
await self.ordertmproductDao.updateByWhere({ payStatus: payStatus }, { where: { needNoOrderNo: action_body.needNoOrderNo, app_id: req.app.id } }, t); await self.ordertmproductDao.updateByWhere({ payStatus: payStatus }, { where: { needNoOrderNo: action_body.needNoOrderNo, app_id: req.app.id } }, t);
var logMsg = { sourceOrderNo: result.deliveryOrderNo, opContent: "订单已成功支付", app_id: req.app.id };
await self.orderflowDao.create(logMsg, t);
return system.getResultSuccess({ deliveryOrderNo: result.deliveryOrderNo }); return system.getResultSuccess({ deliveryOrderNo: result.deliveryOrderNo });
}); });
} }
......
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