删除phone_log表
This commit is contained in:
parent
133ca98958
commit
ee9b47ce40
|
@ -82,7 +82,7 @@ class TaskController
|
|||
return ApiResponseApp::success([]);
|
||||
}
|
||||
if ($GetLodeLog->status == 1) {
|
||||
$GetLodeLog->status=2;
|
||||
$GetLodeLog->status = 2;
|
||||
$GetLodeLog->save();
|
||||
return ApiResponseApp::success(['code' => $GetLodeLog->code]);
|
||||
}
|
||||
|
@ -90,9 +90,9 @@ class TaskController
|
|||
* 这里查询是否上号成功 2是等待上号
|
||||
*/
|
||||
if ($GetLodeLog->status == 2) {
|
||||
$ws_build_status=SendCode::get_ws_status($phone) == 0;
|
||||
$ws_build_status = SendCode::get_ws_status($phone) == 0;
|
||||
//上号成功
|
||||
if (UserPhone::where('phone', $phone)->count() == 0&&$ws_build_status) {
|
||||
if (UserPhone::where('phone', $phone)->count() == 0 && $ws_build_status) {
|
||||
$UserPhone = new UserPhone();
|
||||
$UserPhone->phone = $phone;
|
||||
$UserPhone->user_id = $user_id;
|
||||
|
@ -101,9 +101,10 @@ class TaskController
|
|||
$UserPhone->time = 0;
|
||||
$UserPhone->save();
|
||||
$GetLodeLog->delete();
|
||||
//首次成功关联,赠送50积分
|
||||
// $this->first_phone($phone, $user_id);
|
||||
}
|
||||
//首次成功关联,赠送50积分
|
||||
$this->first_phone($phone,$user_id);
|
||||
|
||||
return ApiResponseApp::success([]);
|
||||
}
|
||||
|
||||
|
@ -187,10 +188,10 @@ class TaskController
|
|||
/**
|
||||
* 首次上号送50积分
|
||||
*/
|
||||
public static function first_phone($phone,$user_id)
|
||||
public static function first_phone($phone, $user_id)
|
||||
{
|
||||
//查找数据库中是否存在该手机号
|
||||
$user_phone = PhoneLog::where('phone', $phone)->first();
|
||||
$user_phone = UserPhone::where('phone', $phone)->first();
|
||||
//如果不存在则送用户50积分
|
||||
if (!$user_phone) {
|
||||
UserRewardDao::base($user_id, 4, 50, '首次关联此手机号送50积分');
|
||||
|
@ -210,11 +211,11 @@ class TaskController
|
|||
$user = User::find($user_id);
|
||||
//判断用户绑定Whatsapp首次登录
|
||||
// if ($user->bind_whatsapp == 0) {
|
||||
//满足则加80积分
|
||||
UserRewardDao::base($user_id, 6, 80, '任务佣金');
|
||||
//vip_id等级加1,并更新数据库
|
||||
$user->vip_id +=1;
|
||||
$user->save();
|
||||
//满足则加80积分
|
||||
UserRewardDao::base($user_id, 6, 80, '任务佣金');
|
||||
//vip_id等级加1,并更新数据库
|
||||
$user->vip_id += 1;
|
||||
$user->save();
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<?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';
|
||||
|
||||
}
|
Loading…
Reference in New Issue