lizhen_gitee 2 年 前
コミット
219bab3fb9

+ 28 - 3
application/api/controller/Unlockorder.php

@@ -14,6 +14,7 @@ class Unlockorder extends Api
 
     //解锁微信订单
     public function wechataccount(){
+        //检查用户
         $to_user_id = input('to_user_id','');
         if(empty($to_user_id)){
             $this->error();
@@ -23,9 +24,20 @@ class Unlockorder extends Api
             $this->error('不存在的用户');
         }
 
+        //检查防重复解锁
+        $check_map = [
+            'user_id' => $this->auth->id,
+            'to_user_id' => $to_user_id,
+            'endtime' => ['gt',time()],
+        ];
+        $check_repeat = Db::name('order_wechataccount')->where($check_map)->find();
+        if(!empty($check_repeat)){
+            $this->error('尚未过期无需再次解锁');
+        }
+
+        //订单
         $price = config('site.unlock_wechataccount');
         $price = bcadd(intval($price),0,0);
-
         $data = [
             'user_id' => $this->auth->id,
             'to_user_id' => $to_user_id,
@@ -42,7 +54,7 @@ class Unlockorder extends Api
         }
 
         if($price > 0){
-            $wallet_rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',$price,71,'解锁:'.$to_user_id,'order_wechataccount',$order_id);
+            $wallet_rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',$price,71,'解锁:'.$to_user_info['username'],'order_wechataccount',$order_id);
             if($wallet_rs['status'] === false){
                 Db::rollback();
                 $this->error($wallet_rs['msg']);
@@ -55,6 +67,7 @@ class Unlockorder extends Api
 
     //解锁私密视频订单
     public function secretvideo(){
+        //检查用户
         $to_user_id = input('to_user_id','');
         if(empty($to_user_id)){
             $this->error();
@@ -64,6 +77,18 @@ class Unlockorder extends Api
             $this->error('不存在的用户');
         }
 
+        //检查防重复解锁
+        $check_map = [
+            'user_id' => $this->auth->id,
+            'to_user_id' => $to_user_id,
+            'endtime' => ['gt',time()],
+        ];
+        $check_repeat = Db::name('order_secretvideo')->where($check_map)->find();
+        if(!empty($check_repeat)){
+            $this->error('尚未过期无需再次解锁');
+        }
+
+        //订单
         $price = config('site.unlock_secretvideo');
         $price = bcadd(intval($price),0,0);
 
@@ -83,7 +108,7 @@ class Unlockorder extends Api
         }
 
         if($price > 0){
-            $wallet_rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',$price,71,'解锁:'.$to_user_id,'order_secretvideo',$order_id);
+            $wallet_rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',$price,72,'解锁:'.$to_user_info['username'],'order_secretvideo',$order_id);
             if($wallet_rs['status'] === false){
                 Db::rollback();
                 $this->error($wallet_rs['msg']);

+ 1 - 0
application/api/controller/Usercenter.php

@@ -254,6 +254,7 @@ class Usercenter extends Api
 
     }
 
+    //因为接受者拿不到发起者的uid,废弃了
     //视频和语音,接收方使用,如果是性别劣势方,检查钱是否够用
     public function video_audio_moneycheck(){
         //检测用户,发起方的uid

+ 6 - 2
二期修改数据库.txt

@@ -7,7 +7,11 @@ mt_user_match_audio_log  新增字段 money    已同步到线上
 mt_user_match_video_log  新增字段 money    已同步到线上
 mt_user_match_typing_log  新增字段 money    已同步到线上
 
+二期===================================================================================
 mt_user 新增字段  wechat_account
-mt_user 新增字段  secretvideo_status  默认值 -1 
+mt_user 新增字段  secretvideo_status  默认值 -1
 
-mt_user_secretvideo 新增全表
+mt_user_secretvideo 新增全表
+
+mt_basedata 新增一行  聊天规范
+网站配置新增  解锁微信号,解锁私密视频