|  | @@ -184,11 +184,12 @@ class Match extends Api
 | 
	
		
			
				|  |  |                  $data['free_money'] = $user_match_video_log_info['free_money'] + $money;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            $log_id = Db::name('user_match_video_log')->where(['id' => $user_match_video_log_info['id']])->setField($data);
 | 
	
		
			
				|  |  | -            if (!$log_id) {
 | 
	
		
			
				|  |  | +            $log_rs = Db::name('user_match_video_log')->where(['id' => $user_match_video_log_info['id']])->update($data);
 | 
	
		
			
				|  |  | +            if (!$log_rs) {
 | 
	
		
			
				|  |  |                  Db::rollback();
 | 
	
		
			
				|  |  |                  $this->error('扣费失败');
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            $log_id = $user_match_video_log_info['id'];
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              //添加记录日志
 | 
	
		
			
				|  |  |              $data = [
 | 
	
	
		
			
				|  | @@ -221,7 +222,7 @@ class Match extends Api
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //补贴给对方0.1金币
 | 
	
		
			
				|  |  |              $money = '10';
 | 
	
		
			
				|  |  | -            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,21,$this->auth->username.'使用免费次数的补贴','user_match_video_log',$log_id);
 | 
	
		
			
				|  |  | +            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,21,'与'.$this->auth->username.'视频通话,新人补贴','user_match_video_log',$log_id,$log_id);
 | 
	
		
			
				|  |  |              if($rs['status'] === false){
 | 
	
		
			
				|  |  |                  Db::rollback();
 | 
	
		
			
				|  |  |                  $this->error($rs['msg']);
 | 
	
	
		
			
				|  | @@ -230,7 +231,7 @@ class Match extends Api
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              //有性别差,扣费
 | 
	
		
			
				|  |  |              if($price > 0){
 | 
	
		
			
				|  |  | -                $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$price,11,'与'.$to_user_info['username'].'视频通话','user_match_video_log',$log_id);
 | 
	
		
			
				|  |  | +                $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$price,11,'与'.$to_user_info['username'].'视频通话','user_match_video_log',$log_id,$log_id);
 | 
	
		
			
				|  |  |                  if($rs['status'] === false){
 | 
	
		
			
				|  |  |                      Db::rollback();
 | 
	
		
			
				|  |  |                      $this->error($rs['msg']);
 | 
	
	
		
			
				|  | @@ -238,7 +239,7 @@ class Match extends Api
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //另一方加钱,0收费
 | 
	
		
			
				|  |  |              if($money > 0){
 | 
	
		
			
				|  |  | -                $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,21,'与'.$this->auth->username.'视频通话','user_match_video_log',$log_id);
 | 
	
		
			
				|  |  | +                $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,21,'与'.$this->auth->username.'视频通话','user_match_video_log',$log_id,$log_id);
 | 
	
		
			
				|  |  |                  if($rs['status'] === false){
 | 
	
		
			
				|  |  |                      Db::rollback();
 | 
	
		
			
				|  |  |                      $this->error($rs['msg']);
 | 
	
	
		
			
				|  | @@ -375,11 +376,12 @@ class Match extends Api
 | 
	
		
			
				|  |  |                  $data['free_money'] = $user_match_audio_log_info['free_money'] + $money;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            $log_id = Db::name('user_match_audio_log')->where(['id' => $user_match_audio_log_info['id']])->setField($data);
 | 
	
		
			
				|  |  | -            if (!$log_id) {
 | 
	
		
			
				|  |  | +            $log_rs = Db::name('user_match_audio_log')->where(['id' => $user_match_audio_log_info['id']])->update($data);
 | 
	
		
			
				|  |  | +            if (!$log_rs) {
 | 
	
		
			
				|  |  |                  Db::rollback();
 | 
	
		
			
				|  |  |                  $this->error('扣费失败');
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            $log_id = $user_match_audio_log_info['id'];
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              //添加记录日志
 | 
	
		
			
				|  |  |              $data = [
 | 
	
	
		
			
				|  | @@ -412,7 +414,7 @@ class Match extends Api
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //补贴给对方0.1金币
 | 
	
		
			
				|  |  |              $money = '10';
 | 
	
		
			
				|  |  | -            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,22,$this->auth->username.'使用免费次数的补贴','user_match_audio_log',$log_id);
 | 
	
		
			
				|  |  | +            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,22,'与'.$this->auth->username.'语音通话,新人补贴','user_match_audio_log',$log_id,$log_id);
 | 
	
		
			
				|  |  |              if($rs['status'] === false){
 | 
	
		
			
				|  |  |                  Db::rollback();
 | 
	
		
			
				|  |  |                  $this->error($rs['msg']);
 | 
	
	
		
			
				|  | @@ -421,7 +423,7 @@ class Match extends Api
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              //有性别差,扣费
 | 
	
		
			
				|  |  |              if($price > 0){
 | 
	
		
			
				|  |  | -                $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$price,12,'与'.$to_user_info['username'].'语音通话','user_match_audio_log',$log_id);
 | 
	
		
			
				|  |  | +                $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$price,12,'与'.$to_user_info['username'].'语音通话','user_match_audio_log',$log_id,$log_id);
 | 
	
		
			
				|  |  |                  if($rs['status'] === false){
 | 
	
		
			
				|  |  |                      Db::rollback();
 | 
	
		
			
				|  |  |                      $this->error($rs['msg']);
 | 
	
	
		
			
				|  | @@ -429,7 +431,7 @@ class Match extends Api
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //另一方加钱,0收费
 | 
	
		
			
				|  |  |              if($money > 0){
 | 
	
		
			
				|  |  | -                $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,22,'与'.$this->auth->username.'语音通话','user_match_audio_log',$log_id);
 | 
	
		
			
				|  |  | +                $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,22,'与'.$this->auth->username.'语音通话','user_match_audio_log',$log_id,$log_id);
 | 
	
		
			
				|  |  |                  if($rs['status'] === false){
 | 
	
		
			
				|  |  |                      Db::rollback();
 | 
	
		
			
				|  |  |                      $this->error($rs['msg']);
 | 
	
	
		
			
				|  | @@ -572,7 +574,7 @@ class Match extends Api
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //补贴给对方0.1金币
 | 
	
		
			
				|  |  |              $money = '0.1';
 | 
	
		
			
				|  |  | -            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,23,$this->auth->username.'使用免费次数的补贴','user_match_typing_log',$log_id);
 | 
	
		
			
				|  |  | +            $rs = model('wallet')->lockChangeAccountRemain($to_user_id,'jewel',$money,23,'与'.$this->auth->username.'聊天,新人补贴','user_match_typing_log',$log_id);
 | 
	
		
			
				|  |  |              if($rs['status'] === false){
 | 
	
		
			
				|  |  |                  Db::rollback();
 | 
	
		
			
				|  |  |                  $this->error($rs['msg']);
 |