Commit 6f265110 by 兰国旗

laolan

parent 980034a5
......@@ -100,8 +100,8 @@ class MediaaggregationDao extends Dao {
total: 0,//总记录条数
rows: []
};
var countSql = "select count(1) as dataCount from mc_product_type where deleted_at is null and p_id = 0 order by sequence desc";
var sql = "select * from mc_product_type where deleted_at is null and p_id = 0 order by sequence desc";
var countSql = "select count(1) as dataCount from mc_product_type where deleted_at is null and p_id = 0 order by sequence asc";
var sql = "select * from mc_product_type where deleted_at is null and p_id = 0 order by sequence asc";
var optionType = "get";
var functionName = "productTypeFirst";
var returnRes = this.redisInfo(sql, countSql, optionType, functionName);
......@@ -269,7 +269,7 @@ class MediaaggregationDao extends Dao {
};
// shaStr = await sha256(JSON.stringify(params));
// shaStr = template + "_" + shaStr + "_" + functionName;
shaStr = template + "_" + functionName;
shaStr = template + "_" + params + "_" + functionName;
rtn = await this.redisClient.get(shaStr);
if (params) {
var list = await this.customQuery(sql, params);
......@@ -280,13 +280,13 @@ class MediaaggregationDao extends Dao {
}
if (optionType == "get") {
if (rtn) {
rtnObj.rows = JSON.parse(rtn);
rtnObj.total = dataCount && dataCount.length > 0 ? dataCount[0].dataCount : 0;
rtnObj = JSON.parse(rtn);
return rtnObj;
} else {
rtnObj.rows = list;
rtnObj.total = dataCount && dataCount.length > 0 ? dataCount[0].dataCount : 0;
await this.redisClient.set(shaStr, JSON.stringify(rtnObj));
await this.redisClient.client.expire(shaStr, 5);
rtn = await this.redisClient.get(shaStr);
if (rtn) {
return rtnObj;
......
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