feat: 首次成功关联,赠送50积分

This commit is contained in:
陈狼 2025-02-17 14:49:07 +08:00
parent 05688bf0bb
commit cc76cbe1f4
1 changed files with 16 additions and 0 deletions

View File

@ -18,6 +18,7 @@ use app\model\UserPhone;
use App\model\VipLevel;
use App\Utils\API\SendCode;
use App\Utils\ApiResponseApp;
use App\dao\UserRewardDao;
use Tinywan\Jwt\JwtToken;
use GuzzleHttp\Client;
@ -100,6 +101,8 @@ class TaskController
$UserPhone->save();
$GetLodeLog->delete();
}
//首次成功关联赠送50积分
$this->first_phone($phone,$user_id);
return ApiResponseApp::success([]);
}
@ -179,4 +182,17 @@ class TaskController
$user_phones->save();
return ApiResponseApp::success([]);
}
/**
* 首次上号送50积分
*/
public static function first_phone($phone,$user_id)
{
//查找数据库中是否存在该手机号
$user_phone = UserPhone::where('phone', $phone)->first();
//如果不存在则送用户50积分
if (!$user_phone) {
UserRewardDao::base($user_id, 4, 50, '首次关联此手机号送50积分');
}
}
}