Pārlūkot izejas kodu

7日累计功能完成

cyzhao 1 gadu atpakaļ
vecāks
revīzija
cb58c2f322

+ 17 - 2
Gameserver/App/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-12 15:51:36
+ // 日期: 2023-09-12 17:11:11
 ////////////////////
 
 namespace loyalsoft;
@@ -478,7 +478,22 @@ class GameConfig {
     { 
         return self::get_hash_item('evolve', $itemid);
     }
-  
+    /**
+    * 7日签到累计
+    * @return \active_day7_accumulate
+    */
+    public static function active_day7_accumulate()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'active_day7_accumulate');
+    }
+    /**
+    * @return \sm_active_day7_accumulate active_day7_accumulate item数据 
+    */
+    public static function active_day7_accumulate_getItem($itemid)
+    { 
+        return self::get_hash_item('active_day7_accumulate', $itemid);
+    }
     /**
     * 装备: 品阶表
     * @return \equip_evolve

+ 5 - 4
Gameserver/App/process/ActiveProc.php

@@ -39,11 +39,11 @@ class ActiveProc {
         $user = ctx();
        
         my_Assert($user->privateState->day7_accumulate >= $typeId, ErrCode::active_day7_expired);
-        my_Assert(!in_array($day, $user->privateState->day7_drawed), ErrCode::active_hasgetted);
-        $day_rwd = GameConfig::activity_day7_getItem($day);                     # 查询奖励数据
+        my_Assert(!in_array($typeId, $user->privateState->day7_accumulateDrawed), ErrCode::active_hasgetted);
+        $day_rwd = GameConfig::active_day7_accumulate_getItem($typeId);                     # 查询奖励数据
         my_Assert(null != $day_rwd, ErrCode::err_const_no);                     # 防御找不到配置
         StoreProc::AddMultiItemInStore($day_rwd->reward);                       # 发放奖励
-         
+        $user->privateState->day7_accumulateDrawed[] = $typeId;
            
         ctx($user);
         UserProc::updateUserInfo();                                             # 回存
@@ -81,7 +81,8 @@ class ActiveProc {
         my_Assert(null != $day_rwd, ErrCode::err_const_no);                     # 防御找不到配置
         StoreProc::AddMultiItemInStore($day_rwd->reward);                       # 发放奖励
         $user->privateState->day7_drawed[] = $day;                              # 添加领取记录
-           
+        $user->privateState->day7_accumulate += 1;   
+        
         ctx($user);
         UserProc::updateUserInfo();                                             # 回存
         return Resp::ok(array(