Commit 5268ef8e by 兰国旗

laolan

parent b2bc534c
...@@ -10,15 +10,14 @@ class MediaaggregationDao extends Dao { ...@@ -10,15 +10,14 @@ class MediaaggregationDao extends Dao {
*/ */
async productList(req) { async productList(req) {
var params = { var params = {
product_type_code: req.actionBody.product_type_code, product_type_code: req.actionBody.product_type_code
company_id: req.actionBody.company_id
}; };
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_product where deleted_at is null and product_type_code = :product_type_code and is_enabled = 1 and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_product where deleted_at is null and product_type_code = :product_type_code and is_enabled = 1 ";
var sql = "select * from mc_product where deleted_at is null and product_type_code = :product_type_code and is_enabled = 1 and company_id = :company_id "; var sql = "select * from mc_product where deleted_at is null and product_type_code = :product_type_code and is_enabled = 1 ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
returnRes.rows = list; returnRes.rows = list;
...@@ -31,19 +30,16 @@ class MediaaggregationDao extends Dao { ...@@ -31,19 +30,16 @@ class MediaaggregationDao extends Dao {
* 轮播图 * 轮播图
*/ */
async rotationChartList(req) { async rotationChartList(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_rotation_chart where deleted_at is null and pic_type = 2 and is_enabled = 1 and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_rotation_chart where deleted_at is null and pic_type = 2 and is_enabled = 1 ";
var sql = "select * from mc_rotation_chart where deleted_at is null and pic_type = 2 and is_enabled = 1 and company_id = :company_id "; var sql = "select * from mc_rotation_chart where deleted_at is null and pic_type = 2 and is_enabled = 1 ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
...@@ -52,19 +48,16 @@ class MediaaggregationDao extends Dao { ...@@ -52,19 +48,16 @@ class MediaaggregationDao extends Dao {
* 列表头图 * 列表头图
*/ */
async tablePicList(req) { async tablePicList(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_rotation_chart where deleted_at is null and pic_type = 1 and is_enabled = 1 and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_rotation_chart where deleted_at is null and pic_type = 1 and is_enabled = 1 ";
var sql = "select * from mc_rotation_chart where deleted_at is null and pic_type = 1 and is_enabled = 1 and company_id = :company_id "; var sql = "select * from mc_rotation_chart where deleted_at is null and pic_type = 1 and is_enabled = 1 ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
...@@ -73,19 +66,16 @@ class MediaaggregationDao extends Dao { ...@@ -73,19 +66,16 @@ class MediaaggregationDao extends Dao {
* 留资表单产品 * 留资表单产品
*/ */
async needProductList(req) { async needProductList(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_second_level_need_config where deleted_at is null and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_second_level_need_config where deleted_at is null ";
var sql = "select * from mc_second_level_need_config where deleted_at is null and company_id = :company_id "; var sql = "select * from mc_second_level_need_config where deleted_at is null ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
...@@ -94,19 +84,16 @@ class MediaaggregationDao extends Dao { ...@@ -94,19 +84,16 @@ class MediaaggregationDao extends Dao {
* 热门推荐 * 热门推荐
*/ */
async popularRecommendationList(req) { async popularRecommendationList(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_popular_recommendation where deleted_at is null and is_enabled = 1 and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_popular_recommendation where deleted_at is null and is_enabled = 1 ";
var sql = "select * from mc_popular_recommendation where deleted_at is null and is_enabled = 1 and company_id = :company_id "; var sql = "select * from mc_popular_recommendation where deleted_at is null and is_enabled = 1 ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
...@@ -115,19 +102,16 @@ class MediaaggregationDao extends Dao { ...@@ -115,19 +102,16 @@ class MediaaggregationDao extends Dao {
* 产品分类一类 * 产品分类一类
*/ */
async productTypeFirst(req) { async productTypeFirst(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_product_type where deleted_at is null and p_id = 0 and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_product_type where deleted_at is null and p_id = 0 ";
var sql = "select * from mc_product_type where deleted_at is null and p_id = 0 and company_id = :company_id "; var sql = "select * from mc_product_type where deleted_at is null and p_id = 0 ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
...@@ -137,15 +121,14 @@ class MediaaggregationDao extends Dao { ...@@ -137,15 +121,14 @@ class MediaaggregationDao extends Dao {
*/ */
async productTypeSecend(req) { async productTypeSecend(req) {
var params = { var params = {
p_product_type_code: req.actionBody.p_product_type_code, p_product_type_code: req.actionBody.p_product_type_code
company_id: req.actionBody.company_id
}; };
var returnRes = { var returnRes = {
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 mc_product.is_enabled = 1 and p_product_type_code = :p_product_type_code and mc_product_type.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 mc_product.is_enabled = 1 and p_product_type_code = :p_product_type_code ";
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 mc_product.is_enabled = 1 and mc_product.p_product_type_code = :p_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 mc_product.is_enabled = 1 and mc_product.p_product_type_code = :p_product_type_code ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
returnRes.rows = list; returnRes.rows = list;
...@@ -158,11 +141,10 @@ class MediaaggregationDao extends Dao { ...@@ -158,11 +141,10 @@ class MediaaggregationDao extends Dao {
*/ */
async productDetail(req) { async productDetail(req) {
var params = { var params = {
code: req.actionBody.code, code: req.actionBody.code
company_id: req.actionBody.company_id
}; };
var sql = "select * from mc_product where deleted_at is null and is_enabled = 1 and code = :code and company_id = :company_id "; var sql = "select * from mc_product where deleted_at is null and is_enabled = 1 and code = :code ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
return list; return list;
} }
...@@ -171,19 +153,16 @@ class MediaaggregationDao extends Dao { ...@@ -171,19 +153,16 @@ class MediaaggregationDao extends Dao {
* 吸底菜单 * 吸底菜单
*/ */
async bottomMenuConfig(req) { async bottomMenuConfig(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_bottom_menu_config where deleted_at is null and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_bottom_menu_config where deleted_at is null ";
var sql = "select * from mc_bottom_menu_config where deleted_at is null and company_id = :company_id "; var sql = "select * from mc_bottom_menu_config where deleted_at is null ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
...@@ -192,19 +171,16 @@ class MediaaggregationDao extends Dao { ...@@ -192,19 +171,16 @@ class MediaaggregationDao extends Dao {
* 周期产品 * 周期产品
*/ */
async cycleProduct(req) { async cycleProduct(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_cycle_product where deleted_at is null and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_cycle_product where deleted_at is null ";
var sql = "select * from mc_cycle_product where deleted_at is null and company_id = :company_id "; var sql = "select * from mc_cycle_product where deleted_at is null ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
...@@ -214,7 +190,6 @@ class MediaaggregationDao extends Dao { ...@@ -214,7 +190,6 @@ class MediaaggregationDao extends Dao {
*/ */
async secondLevelNeedConfig(req) { async secondLevelNeedConfig(req) {
var params = { var params = {
company_id: req.actionBody.company_id,
code: req.actionBody.code code: req.actionBody.code
}; };
...@@ -222,12 +197,12 @@ class MediaaggregationDao extends Dao { ...@@ -222,12 +197,12 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_second_level_need_config where deleted_at is null and company_id = :company_id and code = :code "; var dataCount = "select count(1) as dataCount from mc_second_level_need_config where deleted_at is null and code = :code ";
var sql = "select * from mc_second_level_need_config where deleted_at is null and company_id = :company_id and code = :code"; var sql = "select * from mc_second_level_need_config where deleted_at is null and code = :code";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
...@@ -237,20 +212,16 @@ class MediaaggregationDao extends Dao { ...@@ -237,20 +212,16 @@ class MediaaggregationDao extends Dao {
* 二级产品资质选项 * 二级产品资质选项
*/ */
async clueMaintenance(req) { async clueMaintenance(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = { var returnRes = {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_clue_maintenance where deleted_at is null and company_id = :company_id "; var dataCount = "select count(1) as dataCount from mc_clue_maintenance where deleted_at is null ";
var sql = "select * from mc_clue_maintenance where deleted_at is null and company_id = :company_id "; var sql = "select * from mc_clue_maintenance where deleted_at is null ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql);
returnRes.rows = list; returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params); var tmpResultCount = await this.customQuery(dataCount);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes; return returnRes;
} }
......
...@@ -7,7 +7,7 @@ class MediaaggregationSve { ...@@ -7,7 +7,7 @@ class MediaaggregationSve {
} }
//服务列表 //服务列表
async productList(pobj) { async productList(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id || !pobj.actionBody.product_type_code) { if (!pobj || !pobj.actionBody || !pobj.actionBody.product_type_code) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var res = await mediaaggregationDao.productList(pobj); var res = await mediaaggregationDao.productList(pobj);
...@@ -16,7 +16,7 @@ class MediaaggregationSve { ...@@ -16,7 +16,7 @@ class MediaaggregationSve {
//首页轮播图 //首页轮播图
async rotationChartList(pobj) { async rotationChartList(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -26,7 +26,7 @@ class MediaaggregationSve { ...@@ -26,7 +26,7 @@ class MediaaggregationSve {
//列表头图 //列表头图
async tablePicList(pobj) { async tablePicList(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -35,7 +35,7 @@ class MediaaggregationSve { ...@@ -35,7 +35,7 @@ class MediaaggregationSve {
} }
//留资表单产品 //留资表单产品
async needProductList(pobj) { async needProductList(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -46,7 +46,7 @@ class MediaaggregationSve { ...@@ -46,7 +46,7 @@ class MediaaggregationSve {
//热门推荐 //热门推荐
async popularRecommendationList(pobj) { async popularRecommendationList(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -58,7 +58,7 @@ class MediaaggregationSve { ...@@ -58,7 +58,7 @@ class MediaaggregationSve {
//产品分类一类 //产品分类一类
async productTypeFirst(pobj) { async productTypeFirst(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -68,7 +68,7 @@ class MediaaggregationSve { ...@@ -68,7 +68,7 @@ class MediaaggregationSve {
//产品分类二类 //产品分类二类
async productTypeSecend(pobj) { async productTypeSecend(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.p_product_type_code || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody || !pobj.actionBody.p_product_type_code) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -77,7 +77,7 @@ class MediaaggregationSve { ...@@ -77,7 +77,7 @@ class MediaaggregationSve {
} }
//产品详情 //产品详情
async productDetail(pobj) { async productDetail(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.code || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody || !pobj.actionBody.code) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -87,7 +87,7 @@ class MediaaggregationSve { ...@@ -87,7 +87,7 @@ class MediaaggregationSve {
//吸底菜单 //吸底菜单
async bottomMenuConfig(pobj) { async bottomMenuConfig(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -97,7 +97,7 @@ class MediaaggregationSve { ...@@ -97,7 +97,7 @@ class MediaaggregationSve {
//周期产品 //周期产品
async cycleProduct(pobj) { async cycleProduct(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -108,7 +108,7 @@ class MediaaggregationSve { ...@@ -108,7 +108,7 @@ class MediaaggregationSve {
//二级留资页 //二级留资页
async secondLevelNeedConfig(pobj) { async secondLevelNeedConfig(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id || !pobj.actionBody.code) { if (!pobj || !pobj.actionBody || !pobj.actionBody.code) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -118,7 +118,7 @@ class MediaaggregationSve { ...@@ -118,7 +118,7 @@ class MediaaggregationSve {
//二级产品资质选项 //二级产品资质选项
async clueMaintenance(pobj) { async clueMaintenance(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
......
...@@ -16,7 +16,7 @@ var settings = { ...@@ -16,7 +16,7 @@ var settings = {
salt: "%iatpD1gcxz7iF#B", salt: "%iatpD1gcxz7iF#B",
defaultpwd: "gsb2020", defaultpwd: "gsb2020",
basepath: path.normalize(path.join(__dirname, '../..')), basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 8002, port: process.env.NODE_PORT || 8003,
logindex: "center_manage", logindex: "center_manage",
appname: "gsb_marketplat", appname: "gsb_marketplat",
kongurl: function () { if (this.env == "dev") { var localsettings = require("./localsettings"); return localsettings.kongurl; } else { return ENVINPUT.KONG_ADMIAN; } }, kongurl: function () { if (this.env == "dev") { var localsettings = require("./localsettings"); return localsettings.kongurl; } else { return ENVINPUT.KONG_ADMIAN; } },
......
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