소스 검색

改bug,各项小改动

lizhen_gitee 3 년 전
부모
커밋
354fd3724d

+ 3 - 3
application/admin/controller/Useridconfirm.php

@@ -124,10 +124,10 @@ class Useridconfirm extends Backend
                 }
 
                 //系统消息
-                $msg_id = \app\common\model\Message::addMessage($this->auth->id,'实名认证','实名认证已经审核通过');
-            }else{
+                $msg_id = \app\common\model\Message::addMessage($info['user_id'],'实名认证','实名认证已经审核通过');
+            }elseif($status == 2){
                 //系统消息
-                $msg_id = \app\common\model\Message::addMessage($this->auth->id,'实名认证','实名认证审核不通过');
+                $msg_id = \app\common\model\Message::addMessage($info['user_id'],'实名认证','实名认证审核不通过');
             }
             Db::commit();
 

+ 2 - 2
application/api/controller/Userblack.php

@@ -68,7 +68,7 @@ class Userblack extends Api
 
         $id = Db::name('user_black')->insertGetId($map);
 
-        $this->success('success',$id);
+        $this->success('操作成功',$id);
     }
 
     //取消拉黑某人
@@ -85,6 +85,6 @@ class Userblack extends Api
 
         //不检查,全删
         $rs = Db::name('user_black')->where($map)->delete();
-        $this->success('success');
+        $this->success('操作成功');
     }
 }

+ 40 - 8
application/api/controller/Usercenter.php

@@ -241,7 +241,8 @@ class Usercenter extends Api
         //设置价格
         $price = config('site.video_min_price');
         $price = empty($check) ? 0 : $price;
-
+        $bili  = config('site.money_to_gold');
+        $money = bcdiv($price,$bili,2);
 
         Db::startTrans();
 
@@ -260,13 +261,21 @@ class Usercenter extends Api
         }
 
         //扣费
-        if(!empty($check) && $log_id){
+        if($price > 0){
             $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$price,11,'','user_match_video_log',$log_id);
             if($rs['status'] === false){
                 Db::rollback();
                 $this->error($rs['msg']);
             }
         }
+        //另一方加钱
+        if($money > 0){
+            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'money',$money,21,'','user_match_video_log',$log_id);
+            if($rs['status'] === false){
+                Db::rollback();
+                $this->error($rs['msg']);
+            }
+        }
 
         Db::commit();
         $this->success('success');
@@ -290,7 +299,8 @@ class Usercenter extends Api
         //设置价格
         $price = config('site.audio_min_price');
         $price = empty($check) ? 0 : $price;
-
+        $bili  = config('site.money_to_gold');
+        $money = bcdiv($price,$bili,2);
 
         Db::startTrans();
 
@@ -309,13 +319,21 @@ class Usercenter extends Api
         }
 
         //扣费
-        if(!empty($check) && $log_id){
+        if($price > 0){
             $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$price,12,'','user_match_audio_log',$log_id);
             if($rs['status'] === false){
                 Db::rollback();
                 $this->error($rs['msg']);
             }
         }
+        //另一方加钱
+        if($money > 0){
+            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'money',$money,22,'','user_match_audio_log',$log_id);
+            if($rs['status'] === false){
+                Db::rollback();
+                $this->error($rs['msg']);
+            }
+        }
 
         Db::commit();
         $this->success('success');
@@ -327,6 +345,9 @@ class Usercenter extends Api
 
         //设置价格
         $price = config('site.typing_min_price');
+        $bili  = config('site.money_to_gold');
+        $money = bcdiv($price,$bili,2);
+
 
         Db::startTrans();
 
@@ -345,11 +366,22 @@ class Usercenter extends Api
         }
 
         //扣费
-        $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$price,13,'','user_match_typing_log',$log_id);
-        if($rs['status'] === false){
-            Db::rollback();
-            $this->error($rs['msg']);
+        if($price > 0){
+            $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$price,13,'','user_match_typing_log',$log_id);
+            if($rs['status'] === false){
+                Db::rollback();
+                $this->error($rs['msg']);
+            }
         }
+        //另一方加钱
+        if($money > 0){
+            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'money',$money,23,'','user_match_typing_log',$log_id);
+            if($rs['status'] === false){
+                Db::rollback();
+                $this->error($rs['msg']);
+            }
+        }
+
 
         //tag任务赠送金币
         //搭讪奖励

+ 2 - 2
application/api/controller/Userfollow.php

@@ -82,7 +82,7 @@ class Userfollow extends Api
         }
 
         Db::commit();
-        $this->success('success',$id);
+        $this->success('操作成功',$id);
     }
 
     //取关某人
@@ -105,6 +105,6 @@ class Userfollow extends Api
         //不检查,全删
 
         $rs = Db::name('user_follow')->where($map)->delete();
-        $this->success('success');
+        $this->success('操作成功');
     }
 }

+ 4 - 4
application/api/controller/Userlike.php

@@ -47,9 +47,9 @@ class Userlike extends Api
             }
 
             Db::commit();
-            $this->success('success');
+            $this->success('操作成功');
         }
-        $this->success('success');
+        $this->success('操作成功');
     }
 
     //我喜欢的人列表
@@ -94,7 +94,7 @@ class Userlike extends Api
 
         $id = Db::name('user_like')->insertGetId($map);
 
-        $this->success('success',$id);
+        $this->success('操作成功',$id);
     }
 
     //取关某人
@@ -112,6 +112,6 @@ class Userlike extends Api
         //不检查,全删
 
         $rs = Db::name('user_like')->where($map)->delete();
-        $this->success('success');
+        $this->success('操作成功');
     }
 }

+ 5 - 5
application/common/library/Auth.php

@@ -219,18 +219,18 @@ class Auth
 
         $data = [
             //'username' => $username,
-            'password' => $password,
+            //'password' => $password,
             //'email'    => $email,
             'mobile'   => $mobile,
             /*'level'    => 1,
-            'score'    => 0,
-            'avatar'   => '',*/
+            'score'    => 0,*/
+            'avatar'   => '/assets/img/avatar.png',
             'introcode' => $this->getUinqueNo(8, $introcode),
         ];
         $params = array_merge($data, [
             //'nickname'  => preg_match("/^1[3-9]{1}\d{9}$/",$username) ? substr_replace($username,'****',3,4) : $username,
             'nickname'  => $this->get_rand_nick_name(),
-            'salt'      => Random::alnum(),
+            //'salt'      => Random::alnum(),
             'jointime'  => $time,
             'joinip'    => $ip,
             'logintime' => $time,
@@ -238,7 +238,7 @@ class Auth
             'prevtime'  => $time,
             'status'    => 1
         ]);
-        $params['password'] = $this->getEncryptPassword($password, $params['salt']);
+        //$params['password'] = $this->getEncryptPassword($password, $params['salt']);
         $params = array_merge($params, $extend);
 
         //账号注册时需要开启事务,避免出现垃圾数据

+ 3 - 3
application/extra/wallet.php

@@ -13,9 +13,9 @@ return [
         13 => '文字聊天消费',
         14 => '金币首充赠送',
 
-        21 => '互动收益',
-        22 => '音频收益',
-        23 => '直播收益',
+        21 => '视频通话收益',
+        22 => '语音通话收益',
+        23 => '文字聊天收益',
 
         31 => '购买装扮消费',
         41 => '签到赠送金币',

+ 17 - 0
application/index/controller/Index.php

@@ -50,4 +50,21 @@ class Index extends Frontend
         return $this->view->fetch();
     }
 
+    /**
+     * 判断是安卓还是ios
+     */
+    public function appdownload() {
+        if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
+            header("Location: https://apps.apple.com/cn/app/%E4%BC%B4%E5%A3%B0%E8%AF%AD%E9%9F%B3/id1556551099");
+        }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
+            //$host = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"];
+            //header("Location: ".$host."/index/index/download");
+            $this->view->assign('downurl', /*config("site.apkUrl")*/'baidu.com');
+            return $this->view->fetch();
+        }else{
+            $this->view->assign('downurl', /*config("site.apkUrl")*/'baidu.com');
+            return $this->view->fetch();
+        }
+    }
+
 }

+ 82 - 0
application/index/view/index/appdownload.html

@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>伴声app下载</title>
+    <script src="../../assets/js/fontSize.js"></script>
+</head>
+<style>
+    .wxtip{background: rgba(0,0,0,0.8); text-align: center; position: fixed; left:0; top: 0; width: 100%; height: 100%; z-index: 998; display: none;}
+    .wxtip-icon{width: 52px; height: 67px; background: url(../../assets/img/weixin-tip.png) no-repeat; display: block; position: absolute; right: 20px; top: 20px;}
+    .wxtip-txt{margin-top: 107px; color: #fff; font-size: 16px; line-height: 1.5;}
+
+    * {
+        margin:0;
+        padding:0;
+    }
+    body {
+        background:#edf0f0;
+        font-family:Helvetica Neue,Helvetica,Arial,sans-serif;
+        font-size:14px;
+        color:#333;
+        padding:0;
+        margin:0;
+    }
+    .page{
+        position: relative;
+        left: 0;
+        top: 0;
+        right: 0;
+        bottom: 0;
+        width: 100vw;
+        height: 100vh;
+        background: url(../../assets/img/download.png) no-repeat center/cover;
+    }
+    .btn{
+        width: 290px;
+        height: 45px;
+        background: linear-gradient(90deg, #8F68DD, #6B7DDB);
+        box-shadow: 0px 1px 2px 0px rgba(126, 114, 220, 0.59);
+        line-height: 45px;
+        text-align: center;
+        font-size: 17px;
+        color: #FFFFFF;
+        border-radius: 35px;
+        bottom:26px;
+        left: 50%;
+        transform: translateX(-50%);
+        position: absolute;
+    }
+</style>
+
+<body >
+<div class="page">
+    <a class="btn" href="{$downurl}"  id="JdownApp">点击下载</a>
+</div>
+<div class="wxtip" id="JweixinTip">
+    <span class="wxtip-icon"></span>
+    <p class="wxtip-txt">点击右上角<br/>选择在浏览器中打开</p>
+</div>
+
+</body>
+<script>
+
+    function weixinTip(ele){
+        var ua = navigator.userAgent;
+        var isWeixin = !!/MicroMessenger/i.test(ua);
+        if(isWeixin){
+            ele.onclick=function(e){
+                window.event? window.event.returnValue = false : e.preventDefault();
+                document.getElementById('JweixinTip').style.display='block';
+            }
+            document.getElementById('JweixinTip').onclick=function(){
+                this.style.display='none';
+            }
+        }
+    }
+    var btn1 = document.getElementById('JdownApp');//下载一
+    weixinTip(btn1);
+</script>

BIN
public/assets/img/download.png


+ 14 - 0
public/assets/js/fontSize.js

@@ -0,0 +1,14 @@
+!(function(win, doc) {
+   	function setFontSize() {
+   		var docEl = doc.documentElement;
+   		var winWidth = docEl.clientWidth;
+   		doc.documentElement.style.fontSize = (winWidth / 375) * 10 + 'px';
+   	}
+   	var userAgent = navigator.userAgent;
+	win.addEventListener('resize', function() {
+   		if (navigator.userAgent !== userAgent) {
+   			location.reload();
+   		}
+   	}) 
+	setFontSize();
+   }(window, document));