Commit d96c5dfb by 兰国旗

laolan

parent a10b096c
...@@ -48,6 +48,9 @@ class Mediaaggregation extends APIBase { ...@@ -48,6 +48,9 @@ class Mediaaggregation extends APIBase {
case "rotationChartList"://首页轮播图 case "rotationChartList"://首页轮播图
opResult = await this.mediaaggregationSve.rotationChartList(pobj); opResult = await this.mediaaggregationSve.rotationChartList(pobj);
break; break;
case "tablePicList"://列表头图
opResult = await this.mediaaggregationSve.tablePicList(pobj);
break;
case "needProductList"://留资表单产品 case "needProductList"://留资表单产品
opResult = await this.mediaaggregationSve.needProductList(pobj); opResult = await this.mediaaggregationSve.needProductList(pobj);
break; break;
...@@ -75,6 +78,9 @@ class Mediaaggregation extends APIBase { ...@@ -75,6 +78,9 @@ class Mediaaggregation extends APIBase {
case "clueMaintenance"://二类产品资质选项(选取数据线索的数据) case "clueMaintenance"://二类产品资质选项(选取数据线索的数据)
opResult = await this.mediaaggregationSve.clueMaintenance(pobj); opResult = await this.mediaaggregationSve.clueMaintenance(pobj);
break; break;
case "productListAll"://所有产品及分类
opResult = await this.mediaaggregationSve.productListAll(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -17,8 +17,8 @@ class MediaaggregationDao extends Dao { ...@@ -17,8 +17,8 @@ class MediaaggregationDao extends Dao {
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 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 and company_id = :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 product_type_code = :product_type_code and is_enabled = 1 and company_id = :company_id ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
returnRes.rows = list; returnRes.rows = list;
...@@ -38,8 +38,8 @@ class MediaaggregationDao extends Dao { ...@@ -38,8 +38,8 @@ class MediaaggregationDao extends Dao {
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 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 and company_id = :company_id ";
var sql = "select * from mc_rotation_chart where deleted_at is null and pic_type = 2 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 and company_id = :company_id ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
returnRes.rows = list; returnRes.rows = list;
...@@ -48,6 +48,26 @@ class MediaaggregationDao extends Dao { ...@@ -48,6 +48,26 @@ class MediaaggregationDao extends Dao {
return returnRes; return returnRes;
} }
/**
* 列表头图
*/
async tablePicList(req) {
var params = {
company_id: req.actionBody.company_id
};
var returnRes = {
total: 0,//总记录条数
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 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 list = await this.customQuery(sql, params);
returnRes.rows = list;
var tmpResultCount = await this.customQuery(dataCount, params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return returnRes;
}
/** /**
* 留资表单产品 * 留资表单产品
...@@ -81,8 +101,8 @@ class MediaaggregationDao extends Dao { ...@@ -81,8 +101,8 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数 total: 0,//总记录条数
rows: [] rows: []
}; };
var dataCount = "select count(1) as dataCount from mc_popular_recommendation where deleted_at is null 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 and company_id = :company_id ";
var sql = "select * from mc_popular_recommendation where deleted_at is null and company_id = :company_id "; var sql = "select * from mc_popular_recommendation where deleted_at is null and is_enabled = 1 and company_id = :company_id ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
returnRes.rows = list; returnRes.rows = list;
...@@ -117,15 +137,15 @@ class MediaaggregationDao extends Dao { ...@@ -117,15 +137,15 @@ class MediaaggregationDao extends Dao {
*/ */
async productTypeSecend(req) { async productTypeSecend(req) {
var params = { var params = {
product_type_code: req.actionBody.product_type_code, p_product_type_code: req.actionBody.p_product_type_code,
company_id: req.actionBody.company_id 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 product_type_code = :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 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 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 is 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 list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
returnRes.rows = list; returnRes.rows = list;
...@@ -142,7 +162,7 @@ class MediaaggregationDao extends Dao { ...@@ -142,7 +162,7 @@ class MediaaggregationDao extends Dao {
company_id: req.actionBody.company_id company_id: req.actionBody.company_id
}; };
var sql = "select * from mc_product where deleted_at is null 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 and company_id = :company_id ";
var list = await this.customQuery(sql, params); var list = await this.customQuery(sql, params);
return list; return list;
} }
...@@ -218,8 +238,7 @@ class MediaaggregationDao extends Dao { ...@@ -218,8 +238,7 @@ class MediaaggregationDao extends Dao {
*/ */
async clueMaintenance(req) { async clueMaintenance(req) {
var params = { var params = {
// company_id: req.actionBody.company_id, company_id: req.actionBody.company_id
company_id: 10
}; };
var returnRes = { var returnRes = {
...@@ -236,5 +255,30 @@ class MediaaggregationDao extends Dao { ...@@ -236,5 +255,30 @@ class MediaaggregationDao extends Dao {
return returnRes; return returnRes;
} }
/**
* 所有产品分类及产品
*/
async productListAll(req) {
var params = {
// company_id: req.actionBody.company_id,
company_id: 10
};
var returnRes = {
total: 0,//总记录条数
rows: []
};
var productTypeCount = "select count(1) as productTypeCount from mc_product_type where mc_product_type.deleted_at is null and mc_product_type.company_id= :company_id";
var productTypeSql = "select * from mc_product_type where mc_product_type.deleted_at is null and mc_product_type.company_id= :company_id ";
var list = await this.customQuery(productTypeSql, params);
var tmpResultCount = await this.customQuery(productTypeCount, params);
returnRes.rows = list;
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].productTypeCount : 0;
return returnRes;
}
} }
module.exports = MediaaggregationDao; module.exports = MediaaggregationDao;
\ No newline at end of file
...@@ -23,6 +23,16 @@ class MediaaggregationSve { ...@@ -23,6 +23,16 @@ class MediaaggregationSve {
var res = await mediaaggregationDao.rotationChartList(pobj); var res = await mediaaggregationDao.rotationChartList(pobj);
return system.getResultSuccess(res); return system.getResultSuccess(res);
} }
//列表头图
async tablePicList(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) {
return system.getResultFail(-100, "参数错误");
}
var res = await mediaaggregationDao.tablePicList(pobj);
return system.getResultSuccess(res);
}
//留资表单产品 //留资表单产品
async needProductList(pobj) { async needProductList(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) {
...@@ -58,7 +68,7 @@ class MediaaggregationSve { ...@@ -58,7 +68,7 @@ class MediaaggregationSve {
//产品分类二类 //产品分类二类
async productTypeSecend(pobj) { async productTypeSecend(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.product_type_code || !pobj.actionBody.company_id) { if (!pobj || !pobj.actionBody || !pobj.actionBody.p_product_type_code || !pobj.actionBody.company_id) {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
...@@ -116,6 +126,17 @@ class MediaaggregationSve { ...@@ -116,6 +126,17 @@ class MediaaggregationSve {
return system.getResultSuccess(res); return system.getResultSuccess(res);
} }
//二级产品资质选项
async productListAll(pobj) {
if (!pobj || !pobj.actionBody || !pobj.actionBody.company_id) {
return system.getResultFail(-100, "参数错误");
}
var res = await mediaaggregationDao.productListAll(pobj);
return system.getResultSuccess(res);
}
} }
......
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