UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.63 kB
'use strict';const model=global.getModel("kehoachdtcp"),controller=require("../../controllers/controller"),dmkho=global.getModel("dmkho"),dvcs=global.getModel("dvcs"),dmnv=global.getModel("dmnv"),group=global.getModel("group"),dmbp=global.getModel("dmbp"),dmdt=global.getModel("dmdt"),dmphi=global.getModel("dmphi"),async=require("async"),kehoachdtcp=$contr_router$$=>{$contr_router$$=new controller($contr_router$$,model,"kehoachdtcp",{sort:{ma_dvcs:1,nam:-1,kieu_ky:1,ky:-1,ma_kho:1},unique:"ma_dvcs ma_phi tk nam kieu_ky ky".split(" ")}); $contr_router$$.route();$contr_router$$.view=function($user$$,$result$$,$fn$$){let $id_app$$=$user$$.current_id_app;async.series({dv:$callback$$=>{$result$$.joinModel2($id_app$$,dvcs,{where:"ma_dvcs",fields:{ten_dvcs:"ten_dvcs"}},()=>{$callback$$()})},kho:$callback$$=>{$result$$.joinModel2($id_app$$,dmkho,{where:"ma_kho",fields:{ten_kho:"ten_kho"}},()=>{$callback$$()})},nv:function($callback$$){$result$$.joinModel2($id_app$$,dmnv,{where:"ma_nv",fields:{ten_nv:"ten_nv"}},()=>{$callback$$()})},dmbp:function($callback$$){$result$$.joinModel2($id_app$$, dmbp,{where:"ma_bp",fields:{ten_bp:"ten_bp"}},()=>{$callback$$()})},dmdt:function($callback$$){$result$$.joinModel2($id_app$$,dmdt,{where:"ma_dt",fields:{ten_dt:"ten_dt"}},()=>{$callback$$()})},dmphi:function($callback$$){$result$$.joinModel2($id_app$$,dmphi,{where:"ma_phi",fields:{ten_phi:"ten_phi"}},()=>{$callback$$()})},group:function($callback$$){$result$$.joinModel2($id_app$$,group,{where:{group_id:"_id"},fields:{group_name:"group_name"}},()=>{$callback$$()})}},()=>{$fn$$(null,$result$$)})}}; module.exports=kehoachdtcp;