|
|
@@ -34,7 +34,7 @@ class Airdrop extends Api
|
|
|
$endTime = isset($info->create_time)? bcadd($info->create_time, config('super_weal_end_time')): 0;
|
|
|
|
|
|
$rows = $userWelfare::getIsWelfare();
|
|
|
- $this->success('', ['is_super'=>$this->auth->address_level, 'end_time'=>$endTime, 'chabao'=>$rows->frozen]);
|
|
|
+ $this->success('', ['is_super'=>$this->auth->is_super, 'end_time'=>$endTime, 'chabao'=>$rows->frozen]);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -51,8 +51,8 @@ class Airdrop extends Api
|
|
|
//添加Rwa茶记录
|
|
|
$result = WelfareLoginc::setUserWelfareLos($this->auth->id, $row->new_product_id, $row->new_num, time(), $this->lan, $productOrder::Newbie);
|
|
|
|
|
|
- //添加茶数量
|
|
|
- //if($result['price'] > config('min_rwa_price')) $userModel::updateForRwaNum($this->auth->id, $this->auth->parent_id, $row->new_num, '+');
|
|
|
+ //修改标识
|
|
|
+ $userModel::where('id', $this->auth->id)->update(['is_super'=> $userModel::NewPeo]);
|
|
|
Db::commit();
|
|
|
} catch (\Exception $e) {
|
|
|
Db::rollback();
|
|
|
@@ -69,7 +69,7 @@ class Airdrop extends Api
|
|
|
|
|
|
$row = $userWelfare::getIsWelfare();
|
|
|
if(empty($row->is_super)) $this->error(__('暂未开启'));
|
|
|
- if(!empty($this->auth->address_level)) $this->error(__('您已领取'));
|
|
|
+ if($this->auth->is_super != $userModel::NewPeo) $this->error(__('您已领取'));
|
|
|
|
|
|
//判断距离领取新人福利是否超过一天
|
|
|
$info = $productOrder::getUserWelfare($this->auth->id, $productOrder::Newbie);
|
|
|
@@ -84,10 +84,7 @@ class Airdrop extends Api
|
|
|
$result = WelfareLoginc::setUserWelfareLos($this->auth->id, $row->super_product_id, $row->super_num, time(), $this->lan, $productOrder::Super);
|
|
|
|
|
|
//添加超级福利标识/上级
|
|
|
- $userModel::updateUserLevel($this->auth->id, $this->auth->parent_id);
|
|
|
-
|
|
|
- //添加茶数量
|
|
|
- //if($result['price'] > config('min_rwa_price')) $userModel::updateForRwaNum($this->auth->id, $this->auth->parent_id, $row->super_num, '+');
|
|
|
+ $userModel::updateUserLevel($this->auth->id, $this->auth->parent_id, $this->auth->address_level);
|
|
|
|
|
|
//插入待空投记录
|
|
|
$rs = UserAirdrop::insert([
|