Commit 81cc1a72 by 庄冰

cancel collect

parent 67364f2a
...@@ -35,6 +35,9 @@ class LogoOrderAPI extends APIBase { ...@@ -35,6 +35,9 @@ class LogoOrderAPI extends APIBase {
case "collectLogo"://收藏logo case "collectLogo"://收藏logo
opResult = this.logoOrderSve.collectLogo(pobj); opResult = this.logoOrderSve.collectLogo(pobj);
break; break;
case "cancelCollectLogo"://取消收藏
opResult = this.logoOrderSve.cancelCollectLogo(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -149,10 +149,30 @@ class LogoOrderService { ...@@ -149,10 +149,30 @@ class LogoOrderService {
this.addCollectInfo(appInfo.uapp_id,userInfo.channel_userid,ab); this.addCollectInfo(appInfo.uapp_id,userInfo.channel_userid,ab);
return system.getResultSuccess(); return system.getResultSuccess();
} }
//取消收藏logo
async cancelCollectLogo(pobj){
var ab = pobj.actionBody;
var appInfo = pobj.appInfo;
var userInfo = pobj.userInfo;
if(!appInfo || !appInfo.uapp_id){
return system.getResultFail(-101,"未知应用");
}
if(!userInfo || !userInfo.channel_userid){
return system.getResultFail(-102,"未知用户");
}
if(!ab){
return system.getResultFail(-103,"参数错误");
}
if(!ab.id){
return system.getResultFail(-104,"收藏编号不能为空");
}
var sql = "DELETE FROM `c_collect_info` where id="+ab.id+" and channelUserId='"+userInfo.channel_userid+"'";
this.orderinfoDao.customQuery(sql);
return system.getResultSuccess();
}
addCollectInfo(uapp_id,channelUserId,data) {//新增收藏信息 addCollectInfo(uapp_id,channelUserId,data) {//新增收藏信息
var sql = "INSERT INTO `c_collect_info` (`uapp_id`,`channelUserId`,`collectContent`) VALUE("+uapp_id+",'" + var sql = "INSERT INTO `c_collect_info` (`uapp_id`,`channelUserId`,`collectContent`) VALUE("+uapp_id+",'" +
channelUserId + "','" + JSON.stringify(data) + "')"; channelUserId + "','" + JSON.stringify(data) + "')";
console.log(sql,"1111111111111111111111111111");
this.orderinfoDao.customQuery(sql); this.orderinfoDao.customQuery(sql);
} }
async getCollectibleLogoListByUser(pobj) {//查询logo收藏信息 async getCollectibleLogoListByUser(pobj) {//查询logo收藏信息
......
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