kpiplus
Version:
KPI+
1 lines • 933 B
JavaScript
var model=require("../../models/dmkhuyenmai"),dmvt=require("../../models/dmvt"),dmnvt=require("../../models/dmnvt"),dmkh=require("../../models/customer"),groups=require("../../models/group"),controller=require("../../controllers/controller"),async=require("async"),arrayfuncs=require("../../libs/array-funcs");module.exports=function(e){var n=this.contr=new controller(e,model,"dmkhuyenmai",{sort:{ma_vt:1,ma_kho:1,sl_tu:1,sl_den:1}});n.view=function(e,n,r){id_app=e.current_id_app,async.parallel([function(e){n.joinModel2(id_app,dmvt,{where:"ma_vt",fields:"ten_vt"},function(n){e(null,n)})},function(e){n.joinModel2(id_app,dmnvt,{where:{ma_nvt:"_id"},fields:"ten_nvt"},function(n){e(null,n)})},function(e){n.joinModel2(id_app,dmkh,{where:"ma_kh",fields:"ten_kh"},function(n){e(null,n)})},function(e){n.joinModel2(id_app,groups,{where:{nh_kh:"_id"},fields:"ten_nh_kh"},function(n){e(null,n)})}],function(e,o){r(null,n)})},n.route()};