Commit 33937f26 by 兰国旗

laolan

parent 20bdcd85
...@@ -37,6 +37,7 @@ class Mediaaggregation extends APIBase { ...@@ -37,6 +37,7 @@ class Mediaaggregation extends APIBase {
case "addbrowsingrecord"://添加页面访问记录 case "addbrowsingrecord"://添加页面访问记录
opResult = this.needinfoSve.addbrowsingrecord(pobj); opResult = this.needinfoSve.addbrowsingrecord(pobj);
break; break;
case "productList"://服务列表 case "productList"://服务列表
opResult = await this.mediaaggregationSve.productList(pobj); opResult = await this.mediaaggregationSve.productList(pobj);
break; break;
...@@ -68,5 +69,58 @@ class Mediaaggregation extends APIBase { ...@@ -68,5 +69,58 @@ class Mediaaggregation extends APIBase {
return opResult; return opResult;
} }
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
// async mediAaggregationApi(pobj, qobj, req) {
// if (!pobj.actionType) {
// return system.getResult(null, "actionType参数不能为空");
// }
// var result = await this.mediAaggregationAction(pobj, pobj.actionType, req);
// return result;
// }
// async mediAaggregationAction(pobj, action_type, req) {
// var opResult = null;
// var self = this;
// pobj.xctx = req.xctx;
// switch (action_type) {
// case "test"://测试
// opResult = system.getResultSuccess("测试接口");
// break;
// case "productList"://服务列表
// opResult = await this.mediaaggregationSve.productList(pobj);
// break;
// case "rotationChartList"://首页轮播图
// opResult = await this.mediaaggregationSve.rotationChartList(pobj);
// break;
// case "needProductList"://留资表单产品
// opResult = await this.mediaaggregationSve.needProductList(pobj);
// break;
// case "popularRecommendationList"://热门推荐列表
// opResult = await this.mediaaggregationSve.popularRecommendationList(pobj);
// break;
// case "productTypeFirst"://产品分类列表
// opResult = await this.mediaaggregationSve.productTypeFirst(pobj);
// break;
// case "productTypeSecend"://产品分类列表
// opResult = await this.mediaaggregationSve.productTypeSecend(pobj);
// break;
// case "productDetail"://产品详情页
// opResult = await this.mediaaggregationSve.productDetail(pobj);
// break;
// case "bottomMenuConfig"://吸底菜单
// opResult = await this.mediaaggregationSve.bottomMenuConfig(pobj);
// break;
// default:
// opResult = system.getResult(null, "action_type参数错误");
// }
// return opResult;
// }
} }
module.exports = Mediaaggregation; module.exports = Mediaaggregation;
...@@ -21,11 +21,9 @@ class MediaaggregationDao extends Dao { ...@@ -21,11 +21,9 @@ class MediaaggregationDao extends Dao {
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
returnRes.rows = list; returnRes.rows = list;
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(dataCount,params); var tmpResultCount = await this.customQuery(dataCount,params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes); return returnRes;
return result;
} }
/** /**
...@@ -44,11 +42,9 @@ class MediaaggregationDao extends Dao { ...@@ -44,11 +42,9 @@ class MediaaggregationDao extends Dao {
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
returnRes.rows = list; returnRes.rows = list;
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(dataCount,params); var tmpResultCount = await this.customQuery(dataCount,params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes); return returnRes;
return result;
} }
...@@ -68,11 +64,9 @@ class MediaaggregationDao extends Dao { ...@@ -68,11 +64,9 @@ class MediaaggregationDao extends Dao {
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
returnRes.rows = list; returnRes.rows = list;
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(dataCount,params); var tmpResultCount = await this.customQuery(dataCount,params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes); return returnRes;
return result;
} }
/** /**
...@@ -91,11 +85,9 @@ class MediaaggregationDao extends Dao { ...@@ -91,11 +85,9 @@ class MediaaggregationDao extends Dao {
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
returnRes.rows = list; returnRes.rows = list;
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(dataCount,params); var tmpResultCount = await this.customQuery(dataCount,params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes); return returnRes;
return result;
} }
/** /**
...@@ -114,11 +106,9 @@ class MediaaggregationDao extends Dao { ...@@ -114,11 +106,9 @@ class MediaaggregationDao extends Dao {
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
returnRes.rows = list; returnRes.rows = list;
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(dataCount,params); var tmpResultCount = await this.customQuery(dataCount,params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes); return returnRes;
return result;
} }
/** /**
...@@ -133,27 +123,26 @@ class MediaaggregationDao extends Dao { ...@@ -133,27 +123,26 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_product left join mc_product_type on mc_product.product_type_id = mc_product_type.id where mc_product.deleted_at is null and mc_product_type.deleted_at is null and product_type_code = :product_type_code and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_product left join mc_product_type on mc_product.product_type_id = mc_product_type.id where mc_product.deleted_at is null and mc_product_type.deleted_at is null and product_type_code = :product_type_code and mc_product_type.company_id = :company_id ";
var sql = "select * from mc_product left join mc_product_type on mc_product.product_type_id = mc_product_type.id where mc_product.deleted_at is null and mc_product_type.deleted_at is null and product_type_code = :product_type_code and company_id = :company_id "; var sql = "select * from mc_product left join mc_product_type on mc_product.product_type_id = mc_product_type.id where mc_product.deleted_at is null and mc_product_type.deleted_at is null and product_type_code = :product_type_code and mc_product_type.company_id = :company_id ";
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
returnRes.rows = list; returnRes.rows = list;
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(dataCount,params); var tmpResultCount = await this.customQuery(dataCount,params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes); return returnRes;
return result;
} }
/** /**
* 获取产品详情 * 获取产品详情
*/ */
async productDetail(req) { async productDetail(req) {
var params = { var params = {
product_type_code: req.actionBody.product_type_code, // code: req.actionBody.code,
code: 'code',
company_id: req.actionBody.company_id company_id: req.actionBody.company_id
}; };
var sql = "select * from mc_product where deleted_at is null and product_type_code = :product_type_code and company_id = :company_id "; var sql = "select * from mc_product where deleted_at is null and code = :code and company_id = :company_id ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
return list; return list;
} }
...@@ -174,11 +163,9 @@ class MediaaggregationDao extends Dao { ...@@ -174,11 +163,9 @@ class MediaaggregationDao extends Dao {
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
returnRes.rows = list; returnRes.rows = list;
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(dataCount,params); var tmpResultCount = await this.customQuery(dataCount,params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes); return returnRes;
return result;
} }
} }
......
...@@ -67,7 +67,7 @@ class MediaaggregationSve { ...@@ -67,7 +67,7 @@ class MediaaggregationSve {
} }
//产品详情 //产品详情
async productDetail(pobj) { async productDetail(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.product_type_code || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody || !pobj.actionBody.code || !pobj.actionBody.company_id) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment