feat: 添加用户领取VIP奖励日志模型,并修复VIP奖励逻辑
This commit is contained in:
parent
a461baf360
commit
c91aae31ea
|
@ -303,13 +303,14 @@ class Vip_rewardController
|
|||
}
|
||||
}
|
||||
$UserReward = UserReward::where('memo', '首次VIP'.$vip_id.'等级奖励')->where('user_id', $user_id)->get();
|
||||
// if()
|
||||
//判断是否有
|
||||
// if ($UserReward->count() > 0) {
|
||||
// UserRewardDao::base($user_id, 6, $money, 'VIP'.$vip_id.'等级奖励');
|
||||
// }else{
|
||||
// UserRewardDao::base($user_id, 6, $new_money, '首次VIP'.$vip_id.'等级奖励');
|
||||
if ($UserReward->count() > 0) {
|
||||
UserRewardDao::base($user_id, 6, $money, 'VIP'.$vip_id.'等级奖励');
|
||||
}else{
|
||||
UserRewardDao::base($user_id, 6, $new_money, '首次VIP'.$vip_id.'等级奖励');
|
||||
|
||||
// }
|
||||
}
|
||||
return ApiResponseApp::success('领取成功');
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use support\Model;
|
||||
// 字段注释
|
||||
/**
|
||||
* @var int $id 唯一标识符
|
||||
* @var int $vip_id VIP等级
|
||||
* @var int $user_id 用户ID
|
||||
* @var string $updated_at 更新时间
|
||||
* @var string $created_at 创建时间
|
||||
* @var int $isfirst 是否首次领取(0:不是,1:是)
|
||||
*/
|
||||
class UserReceivesVipLog extends Model
|
||||
{
|
||||
// 设置表名
|
||||
protected $table = 'userreceivesviplog';
|
||||
|
||||
// 设置主键
|
||||
protected $primaryKey = 'id';
|
||||
}
|
Loading…
Reference in New Issue