flexbiz-server
Version:
Flexible Server
3 lines (2 loc) • 719 B
JavaScript
const model=global.getModel("phucap"),controller=require("../../controllers/controller"),phucap=function($router$$){(new controller($router$$,model,"phucap",{sort:{nam:1,thang:-1},onFound:($user$$,$condition$$,$items$$,$next$$)=>{Logger.info("[phucap] found",JSON.stringify($condition$$,null,2));$next$$(null,$items$$)},onView:async($user$$,$items$$,$next$$)=>{await $items$$.filter($item$$=>$item$$.id_ct&&!$item$$.ngay_ct).asyncJoinModel2($user$$.current_id_app,"hd2",{where:{id_ct:"_id"},fields:["ngay_ct"]});
await $items$$.filter($item$$=>$item$$.id_ct&&!$item$$.so_ct).asyncJoinModel2($user$$.current_id_app,"hd2",{where:{id_ct:"_id"},fields:["so_ct"]});$next$$(null,$items$$)}})).route()};module.exports=phucap;