Commit c7bd2282 by 兰国旗

company_id

parent 9cdebda9
......@@ -16,8 +16,8 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数
rows: []
};
var dataCount = "select count(1) as dataCount from mc_product where deleted_at is null ";
var sql = "select * from mc_product where deleted_at is null ";
var dataCount = "select count(1) as dataCount from mc_product where deleted_at is null and company_id = :company_id ";
var sql = "select * from mc_product where deleted_at is null and company_id = :company_id ";
var list = await this.customQuery(sql,params);
returnRes.rows = list;
......@@ -33,15 +33,14 @@ class MediaaggregationDao extends Dao {
*/
async rotationChartList(req){
var params = {
// company_id: req.actionBody.company_id
company_id: 10
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 = 2 ";
var sql = "select * from mc_rotation_chart where deleted_at is null and pic_type = 2 ";
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 sql = "select * from mc_rotation_chart where deleted_at is null and pic_type = 2 and company_id = :company_id ";
var list = await this.customQuery(sql,params);
returnRes.rows = list;
......@@ -64,8 +63,8 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数
rows: []
};
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 ";
var dataCount = "select count(1) as dataCount 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 and company_id = :company_id ";
var list = await this.customQuery(sql,params);
returnRes.rows = list;
......@@ -87,8 +86,8 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数
rows: []
};
var dataCount = "select count(1) as dataCount from mc_popular_recommendation where deleted_at is null ";
var sql = "select * from mc_popular_recommendation where deleted_at is null ";
var dataCount = "select count(1) as dataCount 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 company_id = :company_id ";
var list = await this.customQuery(sql,params);
returnRes.rows = list;
......@@ -110,8 +109,8 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数
rows: []
};
var dataCount = "select count(1) as dataCount from mc_product_type where deleted_at is null and (p_id is null or p_id = '' ) ";
var sql = "select * from mc_product_type where deleted_at is null and ( p_id is null or p_id = '' ) ";
var dataCount = "select count(1) as dataCount from mc_product_type where deleted_at is null and (p_id is null or p_id = '') and company_id = :company_id ";
var sql = "select * from mc_product_type where deleted_at is null and ( p_id is null or p_id = '') and company_id = :company_id ";
var list = await this.customQuery(sql,params);
returnRes.rows = list;
......@@ -134,8 +133,8 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数
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 ";
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";
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 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 list = await this.customQuery(sql,params);
returnRes.rows = list;
......@@ -154,7 +153,7 @@ class MediaaggregationDao extends Dao {
company_id: req.actionBody.company_id
};
var sql = "select * from mc_product where deleted_at is null and product_type_code = :product_type_code";
var sql = "select * from mc_product where deleted_at is null and product_type_code = :product_type_code and company_id = :company_id ";
var list = await this.customQuery(sql, params);
return list;
}
......
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