This commit is contained in:
lingling 2025-02-17 20:21:05 +08:00
commit af674abe8b
4 changed files with 1145 additions and 766 deletions

View File

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

View File

@ -47,9 +47,9 @@ class UserbankController
$password = $request->post('password'); $password = $request->post('password');
$user_id=$request->data['id']; $user_id=$request->data['id'];
$user=User::find($user_id); $user=User::find($user_id);
if (!password_verify($password, $user->password)) { // if (!password_verify($password, $user->password)) {
return ApiResponseApp::error('登录密码错误'); // return ApiResponseApp::error('登录密码错误');
} // }
$userbank = Userbank::where('user_id',$user_id)->first(); $userbank = Userbank::where('user_id',$user_id)->first();
if ($userbank) { if ($userbank) {
$userbank->update([ $userbank->update([

23
app/model/PhoneLog.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace app\model;
use support\Model;
class PhoneLog extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'phone_log';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
}

File diff suppressed because one or more lines are too long