cyzhao 3 سال پیش
والد
کامیت
fc8b79b19f

+ 10 - 0
Gameserver/Amfphp/base/CmdCode.php

@@ -77,6 +77,11 @@ class CmdCode {
      * 临时--正式的要根据具体功能实现
      */
     const cmd_mpay_PayDeliverGoods = 8813;
+    
+    /**
+     * 充值领取奖励
+     */
+    //const cmd_mpay_UserRechargeDrawPrize = 8814;
 //
 //
 // </editor-fold>
@@ -1198,6 +1203,11 @@ class CmdCode {
      * 购买月卡
      */
     const shop_monthlyVIP_Buy = 7104;
+    
+    /**
+     * 获取每日特惠信息
+     */
+    const shop_getDaliySpecial = 7105;    
 //
 // </editor-fold>
 //

+ 7 - 1
Gameserver/Amfphp/base/ErrCode.php

@@ -1507,7 +1507,13 @@ class ErrCode {
      * 月卡已购买,失效前不可再次购买
      */
     const shop_monthlyvip_buyed = 4902;
-
+    
+    /**
+     * 
+     */
+    const shop_daliySpecialRewardNotRepeat = 4903;
+    
+    const shop_firstRechargeNotRepeat = 4904;
 // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="   学院错误码 51xx">
 

+ 17 - 1
Gameserver/Amfphp/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-19 09:45:43
+ // 日期: 2021-12-10 11:44:57
 ////////////////////
 namespace loyalsoft;
 /**
@@ -1592,6 +1592,22 @@ class GameConfig {
         return self::get_hash_item('recharge', $itemid);
     }
     /**
+    * 特惠区别
+    * @return \shop_limit_type
+    */
+    public static function shop_limit_type()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'shop_limit_type');
+    }
+    /**
+    * @return \sm_shop_limit_type shop_limit_type itemArray 
+    */
+    public static function shop_limit_type_getItemArray($key)
+    { 
+        return self::get_hash_item('shop_limit_type', $key);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 17 - 1
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-19 09:45:43
+ // 日期: 2021-12-10 11:44:57
 ////////////////////
 
 /**
@@ -1592,6 +1592,22 @@ class GameConfig {
         return self::get_hash_item('recharge', $itemid);
     }
     /**
+    * 特惠区别
+    * @return \shop_limit_type
+    */
+    public static function shop_limit_type()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'shop_limit_type');
+    }
+    /**
+    * @return \sm_shop_limit_type shop_limit_type itemArray 
+    */
+    public static function shop_limit_type_getItemArray($key)
+    { 
+        return self::get_hash_item('shop_limit_type', $key);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 11 - 1
Gameserver/Amfphp/model/Const/globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-09 11:50:45
+ // 日期: 2021-12-08 17:58:37
 ////////////////////
 
 
@@ -395,11 +395,21 @@ class globalsettings
     */
     public $IdeaBackActive;
 
+    /**
+    * @var Object 描述信息  
+    */
+    public $firstRechargePrizes;
+
     /**
     * @var Object   
     */
     public $BugBackActive;
 
+    /**
+    * @var Object 首次充值金额达到指定值  
+    */
+    public $firstRechargeRMB;
+
     /**
     * @var Object 活动祈愿保底必出UR唤灵师次数设置  
     */

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_drop.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-10-26 18:13:56
+ // 日期: 2021-12-02 17:34:13
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_eventAction.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-15 16:03:50
+ // 日期: 2021-11-23 16:32:24
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_gate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-15 15:58:23
+ // 日期: 2021-12-02 09:45:45
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-11 17:10:18
+ // 日期: 2021-12-10 11:38:24
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_package.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-04-28 11:34:55
+ // 日期: 2021-11-22 14:59:23
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_taskcard.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-15 16:44:23
+ // 日期: 2021-12-08 11:04:59
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_taskcard_type.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-15 16:44:23
+ // 日期: 2021-12-08 11:04:59
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_yanling.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-08-12 15:19:39
+ // 日期: 2021-12-02 12:14:13
 ////////////////////
 
 

+ 6 - 1
Gameserver/Amfphp/model/Const/sm_npc.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-02-10 12:38:34
+ // 日期: 2021-11-23 17:33:43
 ////////////////////
 
 
@@ -68,5 +68,10 @@ class sm_npc
     */
     public $functionPanel;
 
+    /**
+    * @var String 功能参数  
+    */
+    public $functionParam;
+
 }
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_plot.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-16 14:49:24
+ // 日期: 2021-12-10 10:15:17
 ////////////////////
 
 

+ 2 - 2
Gameserver/Amfphp/model/Const/sm_shop_limit.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-09-02 18:00:53
+ // 日期: 2021-12-10 11:43:52
 ////////////////////
 
 
@@ -54,7 +54,7 @@ class sm_shop_limit
     public $reward;
 
     /**
-    * @var String 商品类型分类: 1,限购礼包,2 月卡, 3 充值  
+    * @var String 商品类型分类: 1,限购礼包,2 月卡, 3 充值,4,每日特惠  
     */
     public $goodsType;
 

+ 97 - 0
Gameserver/Amfphp/model/Const/sm_shop_limit_type.php

@@ -0,0 +1,97 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2021-12-10 11:43:52
+////////////////////
+
+
+/**
+ * Static Model shop_limit_type 特惠区别
+ */
+class sm_shop_limit_type
+{
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $id;
+
+    /**
+    * @var Int32 商品ID  
+    */
+    public $typeId;
+
+    /**
+    * @var String 名称  
+    */
+    public $name;
+
+    /**
+    * @var Int32 原价  
+    */
+    public $yuanjia;
+
+    /**
+    * @var Int32 现价  
+    */
+    public $price;
+
+    /**
+    * @var Int32 定价类型: 0.RMB(元), 1.钻石(颗), 2.金币(个) default(0) 
+    */
+    public $pricetype;
+
+    /**
+    * @var String 介绍文字  
+    */
+    public $desc;
+
+    /**
+    * @var String 礼包的道具ID,num  
+    */
+    public $reward;
+
+    /**
+    * @var String 商品类型分类: 1,限购礼包,2 月卡, 3 充值,4,每日特惠  
+    */
+    public $goodsType;
+
+    /**
+    * @var Int32 是否开售: 0 关闭 1开启 default(0) 
+    */
+    public $IsOpen;
+
+    /**
+    * @var Int32 上架排序 default(99999) 
+    */
+    public $Order;
+
+    /**
+    * @var String 物品在商店所属的标签页,每日礼包,每周礼包,每月礼包, 普通月卡,黄金月卡...  
+    */
+    public $subType;
+
+    /**
+    * @var String 礼包图标  
+    */
+    public $icon;
+
+    /**
+    * @var DateTime 上次修改 default(CURRENT_TIMESTAMP) 
+    */
+    public $lastupdate;
+
+    /**
+    * @var Int32 限购次数 default(0) 
+    */
+    public $limit_num;
+
+    /**
+    * @var Int32 标签: 1 免费,2 特价, 3 超值 default(0) 
+    */
+    public $tagType;
+
+}
+

+ 7 - 0
Gameserver/Amfphp/model/User/Data_UserGame.php

@@ -112,6 +112,12 @@ class Data_UserGame extends HashSaver {
      * @var Info_Gem
      */
     public $Gem;
+    
+    /**
+     * 
+     * @var Info_Pay
+     */
+    public $pay;
 
     /**
      * 用于给各个字段赋默认初始值
@@ -159,6 +165,7 @@ class Data_UserGame extends HashSaver {
             $this->college = new Info_College();
             $this->Gem = new Info_Gem();
             $this->shenmiao = new Info_ShenMiao();
+            $this->pay = new Info_Pay();
         } else {                                                                # 实参
             parent::__construct($arg);                                          # 调用Object的构造函数
 //            $this->shopdata = new Info_UserShop($this->shopdata);

+ 22 - 0
Gameserver/Amfphp/model/User/Enum_Recharge.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * Description of Enum_Recharge
+ * 
+ * @author cyzhao
+ */
+class Enum_Recharge extends Enum {
+
+    /**
+     * 直接设置某个值
+     */
+    const FirstRecharge = 1;
+    
+    const monthRecharge = 2;
+    const recharge = 3;
+          
+    const DaliySpecialPackages = 4;
+
+}

+ 34 - 0
Gameserver/Amfphp/model/User/Info_Pay.php

@@ -0,0 +1,34 @@
+<?php
+
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+namespace loyalsoft;
+
+/**
+ * Description of Info_Pay
+ *
+ * @author cyzhao
+ */
+class Info_Pay extends Object_ext {
+    /**
+     * 首冲礼包领取标志
+     * @var type
+     */
+    public $firstRechage = 0;
+    
+    /**
+     * 构造函数
+     * @param type $args
+     */
+    public function __construct($args = null) {    
+        if($args == null){
+            
+        } else {
+            parent::__construct($args);   
+        }                    
+    }
+}

+ 17 - 0
Gameserver/Amfphp/model/User/Info_UserShop.php

@@ -37,5 +37,22 @@ class Info_UserShop extends Object_ext {
      * @var int 至尊月卡购买时间戳
      */
     public $monthlyVIP2_ts = 0;
+    
+    /**
+     * 每日特惠礼包领取记录
+     * @var type
+     */
+    public $daliySpecialPackages = array();
 
+    /**
+     * 重置每日特惠时间
+     * @var type
+     */
+    public $daliySpecialClear_ts = 0;
+    
+    /**
+     * 每日特惠卡周卡开始时间
+     * @var type
+     */
+    public $daliySpecial_ts = 0;
 }

+ 111 - 23
Gameserver/Amfphp/process/PayProc.php

@@ -50,54 +50,142 @@ class PayProc {
 // <editor-fold defaultstate="collapsed" desc=" 支付新版 2021.11.16  ">
             case CmdCode::cmd_mpay_PayDeliverGoods:                                        # 8813 
                 return self::PayDeliverGoods();
+            case CmdCode::cmd_mpay_UserRechargeDrawPrize:
+                return self::UserRechargeDrawPrize();
                 // </editor-fold>
             default:
                 return Resp::err(ErrCode::cmd_err);
         }
     }
+    
     /**
-     * 
+     * 领取奖励
+     * @return type
+     */
+    static function UserRechargeDrawPrize() {
+        list($type,$typeId) = req()->paras;
+        $user = req()->userInfo->game;
+        
+        switch ($type) {
+            case Enum_Recharge::FirstRecharge://首冲
+                my_Assert($user->pay->firstRechage == 0, ErrCode::shop_firstRechargeNotRepeat);
+                
+                StoreProc::AddMultiItemInStore(GameConfig::globalsettings()->firstRechargePrizes);
+                $user->pay->firstRechage = 1;
+                break;
+            case Enum_Recharge::DaliySpecialPackages://每日特惠                           
+                my_Assert(!in_array($typeId, $user->shopdata->daliySpecialPackages), ErrCode::shop_daliySpecialRewardNotRepeat);
+                
+                $mo = GameConfig::shop_limit_getItem($typeId);
+                my_Assert($mo != null, ErrCode::err_const_no);
+                if($mo->price != 0){
+                    my_Assert($user->shopdata->daliySpecial_ts!= 0, ErrCode::shop_daliySpecialRewardNotRepeat);
+                    $ts = $user->shopdata->daliySpecial_ts + 7*24*60*60;
+                    my_Assert(now() < $ts, ErrCode::shop_daliySpecialRewardNotRepeat);                                    
+                }
+                
+                //my_Assert($mo->price != 0, ErrCode::shop_daliySpecialRewardNotRepeat);
+                StoreProc::AddMultiItemInStore($mo->reward);
+                
+                $shopdata = new Info_UserShop(req()->userInfo->game->shopdata);
+                $shopdata->daliySpecialPackages[] = $typeId;
+                req()->userInfo->game->shopdata = $shopdata;
+                break;
+            default:
+                break;
+        }
+        
+        
+        req()->userInfo->game = $user;
+
+        UserProc::updateUserInfo();  
+        return Resp::ok(array(
+                    "pay"=>$user->pay,
+                    "shopdata"=>req()->userInfo->game->shopdata,
+                    "base" => $user->baseInfo,
+                    "store" => $user->store,     
+        ));
+    }
+    
+    /**
+     * 充值发货
      */
     static function PayDeliverGoods() {
         list($cpOrderId) = req()->paras;
         $user = req()->userInfo->game;
                 
-        pay_op::CheckAndDrawOrder(req()->uid,$cpOrderId,array(new PayProc,'distributePayGoods'));  
-        //记录充值金额amount
-        $order = daoInst()->select()->from(self::orderTab)                      # 取订单数据
-                        ->where('cpOrderId')->eq($cpOrderId)
-                        ->limit(1)->fetch();
-        my_Assert($order->product_id != null, ErrCode::pay_order_product_id);
-        
-        $mo = GameConfig::recharge_getItem($order->product_id);
-        my_Assert($mo != null, ErrCode::err_const_no);
+        pay_op::CheckAndDrawOrder(req()->uid,$cpOrderId,array(new PayProc,'distributePayGoods'));
         
-        $cash = $mo->rmd *10;       
-        if($user->baseInfo->charge_amt <= 0){
-            $cash = $mo->rmd *10* $mo->firstDouble;
-        }
-        $user->base()->Add_Cash($cash);
-      
-        $user->baseInfo->charge_amt += $order->amount;                     
         req()->userInfo->game = $user;
 
         UserProc::updateUserInfo();                                             # 回写玩家数据
         return Resp::ok(array(
+                    "pay"=>$user->pay,
                     "base" => $user->baseInfo,
+                    "shopdata"=>$user->shopdata,
                     "store" => $user->store,     
         ));
     }
+    
     //发货
     static function distributePayGoods($order = null) {
-        $str = $order->product_id.",".$order->product_count;   
-        //CLog::pay("支付奖励id".$order->product_id);
-        //CLog::pay("支付奖励num".$order->product_count);
-        $ret = StoreProc::AddMultiItemInStore($str);
+        my_Assert($order->product_id != null, ErrCode::pay_order_product_id);
+        $user = req()->userInfo->game;
+        
+        if ($order->product_id >= 6 && $order->product_id <= 1000) {//充值表
+            $mo = GameConfig::recharge_getItem($order->product_id);
+            my_Assert($mo != null, ErrCode::err_const_no);
+            $cash = $mo->rmd *10;       
+            if($user->baseInfo->charge_amt <= 0){
+                $cash = $mo->rmd *10* $mo->firstDouble;
+            }
+            $user->base()->Add_Cash($cash);                       
+        }          
+        elseif ($order->product_id >= 801001 && $order->product_id <= 899999) {//每日特惠
+            $mo = GameConfig::shop_limit_getItem($order->product_id);
+            if($mo == null){
+                $list = GameConfig::shop_limit_type_getItemArray(Enum_Recharge::DaliySpecialPackages);
+                $cur = 0;
+                foreach ($list as $item) {
+                    $cur += $item->price;
+                }
+                my_Assert($cur == $order->amount, ErrCode::err_const_no);
+                $user->shopdata->daliySpecial_ts = now();
+            } else {
+                StoreProc::AddMultiItemInStore($mo->reward);
+                $user->shopdata->daliySpecialPackages[] = $mo->typeId;
+            }                     
+        }
+        elseif ($order->product_id >= 901001 && $order->product_id <= 999999) {//月卡
+            $shopdata = new Info_UserShop(req()->userInfo->game->shopdata);
+            $packageCfg = GameConfig::shop_monthVIP_getItem($packageId);
+            my_Assert(null != $packageCfg, ErrCode::err_const_no);
+            if ($packageCfg->subType == 4) {
+                my_Assert($shopdata->monthlyVIP1_ts + $packageCfg->ExpireTs * 3600 * 24 < now(), ErrCode::shop_monthlyvip_buyed);
+            } elseif ($packageCfg->subType == 5) {
+                my_Assert($shopdata->monthlyVIP2_ts + $packageCfg->ExpireTs * 3600 * 24 < now(), ErrCode::shop_monthlyvip_buyed);
+            }
+            $err = StoreProc::AddMultiItemInStore($packageCfg->pri_reward);         # 发放一次性奖励
+            my_Assert(ErrCode::ok == $err, $err);
+            if ($packageCfg->subType == 4) {
+                $shopdata->monthlyVIP1_ts = 3600 * 24 * (tsDay() + 1) - 1;           
+            } elseif ($packageCfg->subType == 5) {
+                $shopdata->monthlyVIP2_ts = 3600 * 24 * (tsDay() + 1) - 1;
+            }
+        
+            EmailProc::SendMonthlyVIPDailyReward(req()->zoneid, req()->uid, $packageCfg->name, $packageCfg->daily_reward);
+        
+            req()->userInfo->game->shopdata = $shopdata;
+        }
+        $user->baseInfo->charge_amt += $order->amount;   
+        
+        req()->userInfo->game = $user;
+        
+        return true;
         //CLog::pay("支付奖励回存状态".$ret);
-        return $ret == ErrCode::ok? true:false;       
+        //return $ret == ErrCode::ok? true:false;       
     }
 
-
     /**
      * 8812 查询充值记录 
      */

+ 45 - 2
Gameserver/Amfphp/process/ShopProc.php

@@ -24,18 +24,58 @@ class ShopProc {
                 return self::GetMonthlyVipInfo();
             case CmdCode::shop_monthlyVIP_Buy:
                 return self::BuyMonthlyVip();
-
+            case CmdCode::shop_getDaliySpecial:
+                return self::GetDaliySpecial();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
+    //
+    public static function GetDaliySpecial() {
+        return Resp::ok(array(
+                    "shopdata" => req()->userInfo->game->shopdata
+        ));
+    }
+    
+    /*
+     * 重置每日特惠信息
+     */
+    static function resetDaliySpecialPackages() {             
+        if(req()->userInfo->game->shopdata->daliySpecialClear_ts == 0){
+            req()->userInfo->game->shopdata->daliySpecialClear_ts = now();
+        }
+        $curDay = TimeUtil::tsDay();
+        $lastDay = TimeUtil::tsDay(req()->userInfo->game->shopdata->daliySpecialClear_ts);
+               
+        if($curDay-$lastDay ==1 && TimeUtil::tsHour(req()->userInfo->game->shopdata->daliySpecialClear_ts) < 5 && TimeUtil::tsHour(now()) > 5){              
+            req()->userInfo->game->shopdata->daliySpecialClear_ts = now();
+            req()->userInfo->game->shopdata->daliySpecialPackages = array();                
+        } else if($curDay-$lastDay >1){
+            req()->userInfo->game->shopdata->daliySpecialClear_ts = now();
+            req()->userInfo->game->shopdata->daliySpecialPackages = array(); 
+        }
+        
+        if(TimeUtil::tsDay(req()->userInfo->game->shopdata->daliySpecialClear_ts) == TimeUtil::tsDay() #
+                && TimeUtil::tsHour(req()->userInfo->game->shopdata->daliySpecialClear_ts) < 5 && TimeUtil::tsHour(now()) > 5){
+            req()->userInfo->game->shopdata->daliySpecialClear_ts = now();
+            req()->userInfo->game->shopdata->daliySpecialPackages = array(); 
+        }
+    }
 
+    /**
+     * 获取月卡信息
+     * @return type
+     */
     public static function GetMonthlyVipInfo() {
         return Resp::ok(array(
                     "shopdata" => req()->userInfo->game->shopdata
         ));
     }
 
+    /**
+     * 购买月卡
+     * @return type
+     */
     public static function BuyMonthlyVip() {
         $packageId = req()->paras[0];                                            # 参数; 礼包id
         $shopdata = new Info_UserShop(req()->userInfo->game->shopdata);
@@ -49,10 +89,13 @@ class ShopProc {
         $err = StoreProc::AddMultiItemInStore($packageCfg->pri_reward);         # 发放一次性奖励
         my_Assert(ErrCode::ok == $err, $err);
         if ($packageCfg->subType == 4) {
-            $shopdata->monthlyVIP1_ts = 3600 * 24 * (tsDay() + 1) - 1;
+            $shopdata->monthlyVIP1_ts = 3600 * 24 * (tsDay() + 1) - 1;           
         } elseif ($packageCfg->subType == 5) {
             $shopdata->monthlyVIP2_ts = 3600 * 24 * (tsDay() + 1) - 1;
         }
+        
+        EmailProc::SendMonthlyVIPDailyReward(req()->zoneid, req()->uid, $packageCfg->name, $packageCfg->daily_reward);
+        
         req()->userInfo->game->shopdata = $shopdata;                             # 回写数据
         UserProc::updateUserInfo();
         $user = req()->userInfo->game;

+ 1 - 0
Gameserver/Amfphp/process/UserProc.php

@@ -372,6 +372,7 @@ class UserProc {
             $college->initTaskCard();
 
             req()->userInfo->game->colleg = $college;
+            ShopProc::resetDaliySpecialPackages();                              #每日特惠领奖每日重置
             UserProc::updateUserInfo();                                         # 这一步回存操作只有在 userInfo正常存在的情况下才进行
             $resp = Resp::ok($userInfo);                                        # 设置返回值
             self::backupUserInfo();                                             # 数据回写

+ 5 - 0
Gameserver/Amfphp/util/TimeUtil.php

@@ -170,6 +170,11 @@ class TimeUtil {
         my_Assert(strtolower($fmt) == 'h', '获取Hour的参数只接受: H/h');
         return date($fmt);
     }
+    
+    public static function tsHour($ts,$fmt = 'H') {
+        my_Assert(strtolower($fmt) == 'h', '获取Hour的参数只接受: H/h');
+        return date($fmt,$ts);
+    }
 
 }