flexbiz-server
Version:
Flexible Server
4 lines (3 loc) • 898 B
JavaScript
;const model=global.getModel("dmphatdichvu"),Trangthai=global.getModel("trangthai"),Service=global.getModel("service"),controller=require("../../controllers/controller"),async=require("async");
module.exports=function($contr_router$$){$contr_router$$=new controller($contr_router$$,model,"dmphatdichvu",{sort:{service_code:1,ap_dung_cho:1,thoi_gian_tu:1,thoi_gian_den:1}});$contr_router$$.view=function($user$$,$items$$,$fn$$){let $id_app$$=$user$$.current_id_app;async.series([function($callback$$){$items$$.joinModel2($id_app$$,Service,{where:"service_code",fields:["service_name"]},function($rs$$){$callback$$(null,$rs$$)})},function($callback$$){$items$$.joinModel2(null,Trangthai,{where:$a$$=>
({ma_trang_thai:$a$$.trang_thai,ma_ct:"DMPHATDICHVU"}),fields:["ten_trang_thai"]},function($rs$$){$callback$$(null,$rs$$)})}],function(){$fn$$(null,$items$$)})};$contr_router$$.route()};