...
|
...
|
@@ -255,9 +255,12 @@ class Game extends Api |
|
|
|
|
|
// 获取可以进入的关卡
|
|
|
private function getCurrentBarrierSn(){
|
|
|
// 该进行下一关
|
|
|
$barrier_sn = GameBarrierRank::where('user_id',$this->auth->id)->max('barrier_sn');
|
|
|
$current_barrier = GameBarrier::where('barrier_sn','>',$barrier_sn)->order('barrier_sn')->field('barrier_sn')->find();
|
|
|
return $current_barrier ? $current_barrier['barrier_sn'] : $barrier_sn;
|
|
|
// 最大关
|
|
|
$max_barrier_sn = GameBarrier::max('barrier_sn');
|
|
|
return $current_barrier ? $current_barrier['barrier_sn'] : ($barrier_sn > $max_barrier_sn ? $max_barrier_sn : $barrier_sn);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|