Commit 195cebf8 by 兰国旗

laolan

parent 6ac62af6
...@@ -20,12 +20,9 @@ class MediaaggregationDao extends Dao { ...@@ -20,12 +20,9 @@ class MediaaggregationDao extends Dao {
}; };
var countSql = "select count(1) as dataCount from mc_product where deleted_at is null and product_type_code = :product_type_code and is_enabled = 1 order by sequence desc"; var countSql = "select count(1) as dataCount from mc_product where deleted_at is null and product_type_code = :product_type_code and is_enabled = 1 order by sequence desc";
var sql = "select * from mc_product where deleted_at is null and product_type_code = :product_type_code and is_enabled = 1 order by sequence desc"; var sql = "select * from mc_product where deleted_at is null and product_type_code = :product_type_code and is_enabled = 1 order by sequence desc";
// var optionType = "get"; var optionType = "get";
var functionName = "productList"; var functionName = "productList";
//删除
var optionType = "del";
var returnRes = this.redisInfo(sql, countSql, optionType, functionName, params); var returnRes = this.redisInfo(sql, countSql, optionType, functionName, params);
// var returnRes = this.redisInfo(sql, countSql, optionType, functionName, params);
return returnRes; return returnRes;
} }
...@@ -287,19 +284,15 @@ class MediaaggregationDao extends Dao { ...@@ -287,19 +284,15 @@ class MediaaggregationDao extends Dao {
rtnObj.total = dataCount && dataCount.length > 0 ? dataCount[0].dataCount : 0; rtnObj.total = dataCount && dataCount.length > 0 ? dataCount[0].dataCount : 0;
return rtnObj; return rtnObj;
} else { } else {
rtnObj.rows = JSON.parse(list);
rtnObj.total = dataCount && dataCount.length > 0 ? dataCount[0].dataCount : 0;
await this.redisClient.set(shaStr, JSON.stringify(rtnObj)); await this.redisClient.set(shaStr, JSON.stringify(rtnObj));
rtn = await this.redisClient.get(shaStr); rtn = await this.redisClient.get(shaStr);
if (rtn) { if (rtn) {
rtnObj.rows = JSON.parse(rtn);
rtnObj.total = dataCount && dataCount.length > 0 ? dataCount[0].dataCount : 0;
return rtnObj; return rtnObj;
} }
} }
} }
if (optionType == "del") {
var res = await this.redisClient.delete(shaStr);
return res;
}
} }
} }
module.exports = MediaaggregationDao; module.exports = MediaaggregationDao;
\ No newline at end of file
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