|
@@ -28,6 +28,13 @@ type base_power struct {
|
|
|
Strategy_count int64 //频率数量
|
|
|
}
|
|
|
|
|
|
+//获取所有权益
|
|
|
+func (b *base_power) FindMyPowers(appid string, user_id, ent_id int64) *[]*base_power {
|
|
|
+ now := NowFormat(Date_Full_Layout)
|
|
|
+ list := Mysql_BaseService.SelectBySql(`select * from base_power where appid=? and ((power_type=1 and power_ofid=?) or (power_type=2 and power_ofid=?)) and end_time>? and status=1 order by power_type`, appid, user_id, ent_id, now)
|
|
|
+ return JsonUnmarshal(list, &[]*base_power{}).(*[]*base_power)
|
|
|
+}
|
|
|
+
|
|
|
//查找我的权益
|
|
|
func (b *base_power) FindMyPower(appid, function_code string, user_id, ent_id int64) *[]*base_power {
|
|
|
now := NowFormat(Date_Full_Layout)
|
|
@@ -88,7 +95,7 @@ func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, us
|
|
|
logx.Error(appid, goods_code, goods_spec_id, v.Function_code, "无效的cycle", v.Cycle)
|
|
|
continue
|
|
|
}
|
|
|
- starat_time, end_time := NowFormat(Date_Full_Layout), FormatDate(&end, Date_Full_Layout)
|
|
|
+ start_time, end_time := NowFormat(Date_Full_Layout), FormatDate(&end, Date_Full_Layout)
|
|
|
power_values = append(power_values, start_time, end_time)
|
|
|
use_count := buy_num
|
|
|
if bgs.Calculation_type == 2 {
|
|
@@ -99,7 +106,7 @@ func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, us
|
|
|
if v.Power_type == 2 && v.Power_count == -1 && Base_ent_empower.Count(appid, v.Function_code, ent_id) == 0 {
|
|
|
empower_values = append(empower_values, appid, ent_id, 0, v.Function_code, NowFormat(Date_Full_Layout))
|
|
|
} else if v.Power_type == 2 && v.Power_count > 0 {
|
|
|
- wait_empower_values = append(wait_empower_values, appid, v.Id, ent_id, starat_time, end_time, use_count, v.Power_count, v.Limit_strategy, NowFormat(Date_Full_Layout))
|
|
|
+ wait_empower_values = append(wait_empower_values, appid, v.Id, ent_id, start_time, end_time, use_count, v.Power_count, v.Limit_strategy, NowFormat(Date_Full_Layout))
|
|
|
}
|
|
|
}
|
|
|
}
|