瀏覽代碼

充值金币提醒,后台充值金币海钻提醒,邀请收益提醒

lizhen_gitee 1 年之前
父節點
當前提交
0d40dfbe63

+ 4 - 0
application/admin/controller/Userwallet.php

@@ -96,6 +96,8 @@ class Userwallet extends Backend
                 Db::rollback();
                 $this->error($rs['msg']);
             }
+            //充值通知
+            \app\common\model\Message::addMessage($user_id,"奖励","奖励金币".$jewel);
 
             Db::commit();
             $this->success('充值完成');
@@ -130,6 +132,8 @@ class Userwallet extends Backend
                 Db::rollback();
                 $this->error($rs['msg']);
             }
+            //充值通知
+            \app\common\model\Message::addMessage($user_id,"奖励","奖励海钻".$money);
 
             Db::commit();
             $this->success('充值完成');

+ 4 - 0
application/admin/controller/user/User.php

@@ -106,6 +106,8 @@ class User extends Backend
                 Db::rollback();
                 $this->error($rs['msg']);
             }
+            //充值通知
+            \app\common\model\Message::addMessage($user_id,"奖励","奖励金币".$jewel);
 
             Db::commit();
             $this->success('充值完成');
@@ -140,6 +142,8 @@ class User extends Backend
                 Db::rollback();
                 $this->error($rs['msg']);
             }
+            //充值通知
+            \app\common\model\Message::addMessage($user_id,"奖励","奖励海钻".$money);
 
             Db::commit();
             $this->success('充值完成');

+ 7 - 0
application/api/controller/Notifynew.php

@@ -88,6 +88,10 @@ class Notifynew extends Api
             Db::rollback();
             return false;
         }
+
+        //充值通知
+        \app\common\model\Message::addMessage($orderInfo['user_id'],"充值金币","已充值金币".$args['jewel']);
+
         //找到上级用户并加钱
         $userinfo = Db::name('user')->where('id',$orderInfo['user_id'])->field('id,nickname,pre_userid')->find();
         if($userinfo['pre_userid']){
@@ -100,6 +104,9 @@ class Notifynew extends Api
                     Db::rollback();
                     return false;
                 }
+
+                //充值通知
+                \app\common\model\Message::addMessage($userinfo['pre_userid'],"邀请收益","已获得邀请收益".$jewel);
             }
         }
         //逻辑结束

+ 21 - 0
application/api/controller/Payios.php

@@ -161,6 +161,27 @@ class Payios extends Api
                 Db::rollback();
                 $this->error('充值失败');
             }
+
+            //充值通知
+            \app\common\model\Message::addMessage($order_info['user_id'],"充值金币","已充值金币".$args['jewel']);
+
+            //找到上级用户并加钱
+            $userinfo = Db::name('user')->where('id',$order_info['user_id'])->field('id,nickname,pre_userid')->find();
+            if($userinfo['pre_userid']){
+                $bili = config('site.introsite_recharge_intro_bili') ?: 3;
+                $jewel = bcdiv(bcmul($args['jewel'],$bili,0),100,0);
+                if($jewel > 0){
+                    $result = model('Wallet')->lockChangeAccountRemain($userinfo['pre_userid'],$jewel,'+',0,$userinfo['nickname'].'充值金币返奖励',2,'jewel');
+                    if($result['status']===false)
+                    {
+                        Db::rollback();
+                        return false;
+                    }
+
+                    //充值通知
+                    \app\common\model\Message::addMessage($userinfo['pre_userid'],"邀请收益","已获得邀请收益".$jewel);
+                }
+            }
         }
         //先充值
         if($order_info['table_name'] == 'vip_recharge'){