|
@@ -10,36 +10,7 @@ const hash=require('../class/hash');
|
|
|
var curingUrl ="https://yhuat.smartcost.com.cn/cld"; //'https://yhyun.smartcost.com.cn/cld';
|
|
|
var buildUrl = 'https://yun.smartcost.com.cn/cld';
|
|
|
|
|
|
-/**
|
|
|
- * 分页相关数据计算
|
|
|
- * modelsTable 数据表对象
|
|
|
- * parameter 设置传的参数
|
|
|
- */
|
|
|
-var getPage= async function(modelsTable,where,currentPage,pageSize,parameter,totalCount){
|
|
|
-
|
|
|
- if(!hash.isExistence(totalCount)){
|
|
|
- if(hash.isExistence(where)){
|
|
|
- totalCount=await modelsTable.count({where});
|
|
|
- }else{
|
|
|
- totalCount=await modelsTable.count();
|
|
|
- }
|
|
|
- }
|
|
|
- currentPage=parseInt(currentPage);
|
|
|
- var total =0;
|
|
|
- if(totalCount!=0){
|
|
|
- total = Math.trunc ( totalCount / pageSize );
|
|
|
- }
|
|
|
- var totalPage = (totalCount % pageSize) == 0 ? total : total + 1;
|
|
|
|
|
|
- var page={
|
|
|
- 'currentPage':currentPage, //当前页
|
|
|
- 'previousPage':currentPage!=0?currentPage-1:currentPage, //上一页
|
|
|
- 'nextPage': currentPage==totalPage ? totalPage:currentPage+1,
|
|
|
- 'totalPage':totalPage,
|
|
|
- 'parameter':encodeURI(parameter)
|
|
|
- };
|
|
|
- return page;
|
|
|
-}
|
|
|
|
|
|
var cloudService={
|
|
|
|
|
@@ -58,10 +29,12 @@ var cloudService={
|
|
|
var pg=page-1;
|
|
|
offset=pg*limit;
|
|
|
}
|
|
|
- var url= curingUrl+'/getCompilationList';
|
|
|
- var curingCloudList={}; //await curlRequest(url);
|
|
|
+ var url= curingUrl+'/cld/getUserList';
|
|
|
+ var curingCloudList=await curlRequest(url);
|
|
|
+
|
|
|
+ console.log(curingCloudList);
|
|
|
|
|
|
- //console.log(curingCloudList);
|
|
|
+ return '';
|
|
|
|
|
|
//组合数据以获得本地扩展数据
|
|
|
var mobile=[];
|
|
@@ -501,6 +474,35 @@ var modelsQuery= async function(sql){
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 分页相关数据计算
|
|
|
+ * modelsTable 数据表对象
|
|
|
+ * parameter 设置传的参数
|
|
|
+ */
|
|
|
+var getPage= async function(modelsTable,where,currentPage,pageSize,parameter,totalCount){
|
|
|
+
|
|
|
+ if(!hash.isExistence(totalCount)){
|
|
|
+ if(hash.isExistence(where)){
|
|
|
+ totalCount=await modelsTable.count({where});
|
|
|
+ }else{
|
|
|
+ totalCount=await modelsTable.count();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ currentPage=parseInt(currentPage);
|
|
|
+ var total =0;
|
|
|
+ if(totalCount!=0){
|
|
|
+ total = Math.trunc ( totalCount / pageSize );
|
|
|
+ }
|
|
|
+ var totalPage = (totalCount % pageSize) == 0 ? total : total + 1;
|
|
|
|
|
|
+ var page={
|
|
|
+ 'currentPage':currentPage, //当前页
|
|
|
+ 'previousPage':currentPage!=0?currentPage-1:currentPage, //上一页
|
|
|
+ 'nextPage': currentPage==totalPage ? totalPage:currentPage+1,
|
|
|
+ 'totalPage':totalPage,
|
|
|
+ 'parameter':encodeURI(parameter)
|
|
|
+ };
|
|
|
+ return page;
|
|
|
+}
|
|
|
|
|
|
|