flexbiz-server
Version:
Flexible Server
5 lines (4 loc) • 1.65 kB
JavaScript
'use strict';exports.isTkcn=[function($id_app$$,$tk$$,$callback$$){$tk$$?($tk$$=$tk$$.trim(),global.getModel("account").findOne({id_app:$id_app$$,tk:$tk$$},{tk_cn:1,_id:0,loai_tk:1},function($error$$,$acc$$){$error$$||!$acc$$||0===$acc$$.loai_tk?$callback$$(!1):$callback$$($acc$$.tk_cn)})):$callback$$(!0)},"T\u00e0i kho\u1ea3n {VALUE} kh\u00f4ng t\u1ed3n t\u1ea1i ho\u1eb7c kh\u00f4ng ph\u1ea3i l\u00e0 t\u00e0i kho\u1ea3n c\u00f4ng n\u1ee3"];
exports.isNotTkcn=[function($id_app$$,$tk$$,$callback$$){$tk$$?($tk$$=$tk$$.trim(),global.getModel("account").findOne({id_app:$id_app$$,tk:$tk$$},{tk_cn:1,_id:0,loai_tk:1},function($error$$,$acc$$){$error$$||!$acc$$||0===$acc$$.loai_tk?$callback$$(!1):$callback$$(!$acc$$.tk_cn)})):$callback$$(!0)},"T\u00e0i kho\u1ea3n {VALUE} kh\u00f4ng t\u1ed3n t\u1ea1i ho\u1eb7c kh\u00f4ng ph\u1ea3i l\u00e0 t\u00e0i kho\u1ea3n c\u00f4ng n\u1ee3"];
exports.existsTk=[function($id_app$$,$tk$$,$callback$$){$tk$$?($tk$$=$tk$$.trim(),global.getModel("account").findOne({id_app:$id_app$$,tk:$tk$$},{tk:1,loai_tk:1},function($error$$,$acc$$){$error$$&&console.log($error$$);$acc$$||console.log("not found "+$tk$$+" of app "+$id_app$$);$error$$||!$acc$$||0===$acc$$.loai_tk?$callback$$(!1):$callback$$(!0)})):$callback$$(!0)},"T\u00e0i kho\u1ea3n {VALUE} kh\u00f4ng t\u1ed3n t\u1ea1i"];
exports.existsAnyTk=[function($id_app$$,$tk$$,$callback$$){$tk$$?($tk$$=$tk$$.trim(),global.getModel("account").findOne({id_app:$id_app$$,tk:$tk$$},{tk:1},function($error$$,$acc$$){$error$$||!$acc$$||0===$acc$$.loai_tk?$callback$$(!1):$callback$$(!0)})):$callback$$(!0)},"T\u00e0i kho\u1ea3n {VALUE} kh\u00f4ng t\u1ed3n t\u1ea1i"];