Merge branch 'master' of https://git.shagain.club/shulang/webman
This commit is contained in:
commit
af674abe8b
|
@ -16,8 +16,10 @@ use App\model\Carouselad;
|
|||
use app\model\GetLodeLog;
|
||||
use app\model\UserPhone;
|
||||
use App\model\VipLevel;
|
||||
use App\model\PhoneLog;
|
||||
use App\Utils\API\SendCode;
|
||||
use App\Utils\ApiResponseApp;
|
||||
use App\dao\UserRewardDao;
|
||||
use Tinywan\Jwt\JwtToken;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
|
@ -100,6 +102,8 @@ class TaskController
|
|||
$UserPhone->save();
|
||||
$GetLodeLog->delete();
|
||||
}
|
||||
//首次成功关联,赠送50积分
|
||||
$this->first_phone($phone,$user_id);
|
||||
return ApiResponseApp::success([]);
|
||||
}
|
||||
|
||||
|
@ -179,4 +183,17 @@ class TaskController
|
|||
$user_phones->save();
|
||||
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积分');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,9 +47,9 @@ class UserbankController
|
|||
$password = $request->post('password');
|
||||
$user_id=$request->data['id'];
|
||||
$user=User::find($user_id);
|
||||
if (!password_verify($password, $user->password)) {
|
||||
return ApiResponseApp::error('登录密码错误');
|
||||
}
|
||||
// if (!password_verify($password, $user->password)) {
|
||||
// return ApiResponseApp::error('登录密码错误');
|
||||
// }
|
||||
$userbank = Userbank::where('user_id',$user_id)->first();
|
||||
if ($userbank) {
|
||||
$userbank->update([
|
||||
|
|
|
@ -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
Loading…
Reference in New Issue