|
@@ -154,7 +154,11 @@ func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, ac
|
|
|
|
|
|
//取消权益
|
|
//取消权益
|
|
func (b *base_power) CancelPower(appid, goods_code string, spec_id, account_id, ent_account_id int64) bool {
|
|
func (b *base_power) CancelPower(appid, goods_code string, spec_id, account_id, ent_account_id int64) bool {
|
|
|
|
+ accountId := account_id
|
|
|
|
+ if accountId == 0 {
|
|
|
|
+ accountId = ent_account_id
|
|
|
|
+ }
|
|
return Mysql_BaseService.UpdateOrDeleteBySql(`update base_power a inner join base_goods_spec_power b
|
|
return Mysql_BaseService.UpdateOrDeleteBySql(`update base_power a inner join base_goods_spec_power b
|
|
- on (a.appid=? and ((a.account_id=? and a.power_type=1) or (a.account_id=? and a.power_type=2)) and a.status=1 and b.appid=? and b.goods_code=? and b.spec_id=? and a.function_code=b.function_code)
|
|
|
|
- set a.status=-1,update_time=?`, appid, account_id, ent_account_id, appid, goods_code, spec_id, NowFormat(Date_Full_Layout)) > 0
|
|
|
|
|
|
+ on (a.appid=? and a.account_id=? and a.status=1 and b.appid=? and b.goods_code=? and b.spec_id=? and a.goods_spec_power_id=b.id)
|
|
|
|
+ set a.status=-1,update_time=?`, appid, accountId, appid, goods_code, spec_id, NowFormat(Date_Full_Layout)) > 0
|
|
}
|
|
}
|