|
@@ -97,14 +97,14 @@ func (b *base_power) OpenPower(appid, goods_code string, user_id, ent_id int64,
|
|
|
func (b *base_power) CancelPower(appid, goods_code string, user_id, ent_id int64) bool {
|
|
|
return Mysql_BaseService.ExecTx("取消权益", func(tx *sql.Tx) bool {
|
|
|
ok1, ok2 := false, false
|
|
|
- if ent_id > 0 {
|
|
|
+ if user_id > 0 {
|
|
|
ok1 = Mysql_BaseService.UpdateOrDeleteBySqlByTx(tx, `update base_power a inner join base_goods_function b
|
|
|
- on (a.appid=? and a.power_type=1 and a.power_ofid=? and b.appid=? and a.goods_code=? and b.power_type=1 and a.function_code=b.function_code)
|
|
|
+ on (a.appid=? and a.power_type=1 and a.power_ofid=? and b.appid=? and b.goods_code=? and b.power_type=1 and a.function_code=b.function_code)
|
|
|
set a.status=-1`, appid, user_id, appid, goods_code) > 0
|
|
|
}
|
|
|
- if user_id > 0 {
|
|
|
+ if ent_id > 0 {
|
|
|
ok2 = Mysql_BaseService.UpdateOrDeleteBySqlByTx(tx, `update base_power a inner join base_goods_function b
|
|
|
- on (a.appid=? and a.power_type=2 and a.power_ofid=? and b.appid=? and a.goods_code=? and b.power_type=2 and a.function_code=b.function_code)
|
|
|
+ on (a.appid=? and a.power_type=2 and a.power_ofid=? and b.appid=? and b.goods_code=? and b.power_type=2 and a.function_code=b.function_code)
|
|
|
set a.status=-1`, appid, ent_id, appid, goods_code) > 0
|
|
|
}
|
|
|
return ok1 || ok2
|