Commit c37cf26a by 兰国旗

laolan

parent 6c43fe21
...@@ -62,6 +62,9 @@ class Mediaaggregation extends APIBase { ...@@ -62,6 +62,9 @@ class Mediaaggregation extends APIBase {
case "bottomMenuConfig"://吸底菜单 case "bottomMenuConfig"://吸底菜单
opResult = await this.mediaaggregationSve.bottomMenuConfig(pobj); opResult = await this.mediaaggregationSve.bottomMenuConfig(pobj);
break; break;
case "cycleProduct"://周期产品
opResult = await this.mediaaggregationSve.cycleProduct(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -102,8 +102,8 @@ class MediaaggregationDao extends Dao { ...@@ -102,8 +102,8 @@ class MediaaggregationDao extends Dao {
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 is null or p_id = '') 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 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 sql = "select * from mc_product_type where deleted_at is null and p_id = 0 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;
...@@ -168,5 +168,26 @@ class MediaaggregationDao extends Dao { ...@@ -168,5 +168,26 @@ class MediaaggregationDao extends Dao {
return returnRes; return returnRes;
} }
/**
* 周期产品
*/
async cycleProduct(req) {
var params = {
company_id: 10
};
var returnRes = {
total: 0,//总记录条数
rows: []
};
var dataCount = "select count(1) as dataCount 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 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;
}
} }
module.exports = MediaaggregationDao; module.exports = MediaaggregationDao;
\ No newline at end of file
...@@ -85,6 +85,15 @@ class MediaaggregationSve { ...@@ -85,6 +85,15 @@ class MediaaggregationSve {
return system.getResultSuccess(res); return system.getResultSuccess(res);
} }
//周期产品
async cycleProduct(pobj) {
if (!pobj || !pobj.actionBody|| !pobj.actionBody.company_id) {
return system.getResultFail(-100, "参数错误");
}
var res =await mediaaggregationDao.cycleProduct(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