|
@@ -34,31 +34,60 @@ class FightProc {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 章节宝箱的领取
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
public static function PassGateTsPrizeReceive() {
|
|
|
list($gateId,$index) = req()->paras;
|
|
|
|
|
|
$gateMo = GameConfig::gate_getItem($gateId);
|
|
|
my_Assert($gateMo!=null, ErrCode::err_const_no);
|
|
|
|
|
|
+ my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId), ErrCode::user_Gate_NoUserGateInfo);
|
|
|
+ $gateInfo = ctx()->gates->GateList->$gateId;
|
|
|
|
|
|
+ $tag = false;
|
|
|
+ $prize = "";
|
|
|
+ $mask =0;
|
|
|
+ switch ($index) {
|
|
|
+ case 1:
|
|
|
+ $ts = $gateMo->first_ts1 *60;
|
|
|
+ if($ts >= $gateInfo->MaxSeconds){
|
|
|
+ $tag = true;
|
|
|
+ }
|
|
|
+ $mask=1;
|
|
|
+ $prize = $gateMo->first_reward1;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ $ts = $gateMo->first_ts2*60;
|
|
|
+ if($ts >= $gateInfo->MaxSeconds){
|
|
|
+ $tag = true;
|
|
|
+ }
|
|
|
+ $mask = 2;
|
|
|
+ $prize = $gateMo->first_reward2;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ if($gateInfo->pass > 0){
|
|
|
+ $tag = true;
|
|
|
+ }
|
|
|
+ $mask =3;
|
|
|
+ $prize = $gateMo->first_reward3;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
-// $prizelist = ctx()->fight()->gateTsPrizeRevicedList;
|
|
|
-// $recordlist = ctx()->fight()->gateTsRecord;
|
|
|
-// for($i = $index -1 ; $i >0; $i--){//校验是否满足条件
|
|
|
-// $str = $gateId.'-'.$i;
|
|
|
-// my_Assert(in_array($str, $recordlist) && in_array($str, $prizelist), ErrCode::err_const_no);
|
|
|
-// }
|
|
|
-//
|
|
|
-// my_Assert(in_array($str, $recordlist) && !in_array($str, $prizelist), ErrCode::err_const_no);
|
|
|
-//
|
|
|
-// $key = 'first_reward'.$index;
|
|
|
-// StoreProc::AddMultiItemInStore($gateMo->$key);
|
|
|
-// ctx()->fight()->gateTsPrizeRevicedList[] = $gateId.'-'.$index;
|
|
|
-
|
|
|
+ if($tag){
|
|
|
+ StoreProc::AddMultiItemInStore($prize);
|
|
|
+ $gateInfo->FirstReward = $mask;
|
|
|
+ }
|
|
|
+ ctx()->gates->GateList->$gateId=$gateInfo;
|
|
|
+
|
|
|
UserProc::updateUserInfo();
|
|
|
$ret = array(
|
|
|
- 'gateTsPrize' => ctx()->fight()->gateTsPrizeRevicedList,
|
|
|
- 'store' => 'ok',
|
|
|
+ 'gate' => $gateInfo,
|
|
|
+ 'store' => ctx()->store,
|
|
|
);
|
|
|
return Resp::ok($ret);
|
|
|
}
|