flexbiz-server
Version:
Flexible Server
4 lines (3 loc) • 744 B
JavaScript
const model=global.getModel("congdoansx"),Participant=global.getModel("participant"),controller=require("../../controllers/controller"),async=require("async");
module.exports=function($router$$){(new controller($router$$,model,"congdoansx",{sort:{stt:1},unique:["ma_cong_doan"],onView:function($user$$,$items$$,$next$$){async.series({pt:function($callback$$){$items$$.joinModel2($user$$.current_id_app,Participant,[{where:{phu_trach:"email"},fields:[{ten_phu_trach:"name"}]}],function(){$callback$$(null,$items$$)})},ph:function($callback$$){$items$$.joinModel2($user$$.current_id_app,Participant,[{where:{phoi_hop:"email"},fields:[{ten_phoi_hop:"name"}]}],function(){$callback$$(null,
$items$$)})}},()=>{$next$$(null,$items$$)})}})).route()};