|
@@ -80,6 +80,7 @@ class Match extends Api
|
|
|
Db::startTrans();
|
|
|
|
|
|
//检查剩余分钟数
|
|
|
+ $task_status = 0;//任务状态
|
|
|
$user_wallet = Db::name('user_wallet')->where('user_id',$this->auth->id)->lock(true)->find();
|
|
|
if($user_wallet['video_sec'] >= 1){
|
|
|
//扣分钟数
|
|
@@ -87,6 +88,7 @@ class Match extends Api
|
|
|
//补贴给对方0.1金币
|
|
|
$money = 0.1;
|
|
|
}else{
|
|
|
+ $task_status = 1;
|
|
|
//需要扣别人的钱,判断钱是否购
|
|
|
if($price > 0){
|
|
|
$goldtotal = model('wallet')->getWallettotal($this->auth->id);
|
|
@@ -172,15 +174,17 @@ class Match extends Api
|
|
|
|
|
|
//tag任务赠送金币
|
|
|
//与1名异性语音通话奖励
|
|
|
- $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,11);
|
|
|
- if($task_rs === false){
|
|
|
- Db::rollback();
|
|
|
- $this->error('完成任务赠送奖励失败');
|
|
|
- }
|
|
|
- $task_rs = \app\common\model\TaskLog::tofinish($to_user_id,11);
|
|
|
- if($task_rs === false){
|
|
|
- Db::rollback();
|
|
|
- $this->error('完成任务赠送奖励失败');
|
|
|
+ if($task_status == 1){
|
|
|
+ $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,11);
|
|
|
+ if($task_rs === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('完成任务赠送奖励失败');
|
|
|
+ }
|
|
|
+ $task_rs = \app\common\model\TaskLog::tofinish($to_user_id,11);
|
|
|
+ if($task_rs === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('完成任务赠送奖励失败');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Db::commit();
|
|
@@ -216,6 +220,7 @@ class Match extends Api
|
|
|
Db::startTrans();
|
|
|
|
|
|
//检查剩余分钟数
|
|
|
+ $task_status = 0;//任务状态
|
|
|
$user_wallet = Db::name('user_wallet')->where('user_id',$this->auth->id)->lock(true)->find();
|
|
|
if($user_wallet['audio_sec'] >= 1){
|
|
|
//扣分钟数
|
|
@@ -223,6 +228,7 @@ class Match extends Api
|
|
|
//补贴给对方0.1金币
|
|
|
$money = 0.1;
|
|
|
}else{
|
|
|
+ $task_status = 1;
|
|
|
//需要扣别人的钱,判断钱是否购
|
|
|
if($price > 0){
|
|
|
$goldtotal = model('wallet')->getWallettotal($this->auth->id);
|
|
@@ -307,15 +313,17 @@ class Match extends Api
|
|
|
|
|
|
//tag任务赠送金币
|
|
|
//与1名异性语音通话奖励
|
|
|
- $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,11);
|
|
|
- if($task_rs === false){
|
|
|
- Db::rollback();
|
|
|
- $this->error('完成任务赠送奖励失败');
|
|
|
- }
|
|
|
- $task_rs = \app\common\model\TaskLog::tofinish($to_user_id,11);
|
|
|
- if($task_rs === false){
|
|
|
- Db::rollback();
|
|
|
- $this->error('完成任务赠送奖励失败');
|
|
|
+ if($task_status == 1){
|
|
|
+ $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,11);
|
|
|
+ if($task_rs === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('完成任务赠送奖励失败');
|
|
|
+ }
|
|
|
+ $task_rs = \app\common\model\TaskLog::tofinish($to_user_id,11);
|
|
|
+ if($task_rs === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('完成任务赠送奖励失败');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Db::commit();
|