通知签约上级徒弟48小时后到期
This commit is contained in:
@@ -51,15 +51,6 @@ class PerformPerSecond
|
||||
$this->sign_room_time_end();
|
||||
echo "\n";
|
||||
|
||||
echo "公会会员结算比例申请过期处理:\n";
|
||||
$this->user_ratio_up_apply_timeout();
|
||||
echo "\n";
|
||||
|
||||
echo "通知签约上级徒弟48小时后到期:\n";
|
||||
$this->sign_notice();
|
||||
echo "\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -374,47 +365,4 @@ class PerformPerSecond
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//公会会员结算比例申请过期处理
|
||||
public function user_ratio_up_apply_timeout(){
|
||||
//超过24小时的数据
|
||||
$end_time = time() - 60 * 60 * 24;
|
||||
$up_count = 0;
|
||||
$guild_user_ratio_up_log = Db::name('vs_guild_user_ratio_up_log')->where(['status' => 0,'createtime' => ['<',$end_time]])->select();
|
||||
if($guild_user_ratio_up_log){
|
||||
foreach ($guild_user_ratio_up_log as $value){
|
||||
$re = Db::name('vs_guild_user_ratio_up_log')->where('id',$value['id'])->update(['status' => 2,'updatetime' => time()]);
|
||||
if($re){
|
||||
$up_count++;
|
||||
echo "处理成功:".$value['id']."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "公会会员结算比例申请过期处理结束-共". count($guild_user_ratio_up_log) . "条数据(已处理". $up_count . "条数据`)\n";
|
||||
}
|
||||
|
||||
//通知签约上级徒弟48小时后到期
|
||||
public function sign_notice(){
|
||||
$user_sign = Db::name('vs_user_sign')->where(['status' => 1,'end_time' => ['>',time()],'is_notice' => 0])->select();
|
||||
$user_sign_sed_count = 0;
|
||||
if($user_sign){
|
||||
foreach ($user_sign as $value){
|
||||
//剩余时间
|
||||
$time = $value['end_time'] - time();
|
||||
if($time < 60 * 60 * 48){
|
||||
$user_info = Db::name('user')->where('id',$value['sign_user_id'])->find();
|
||||
if($user_info){
|
||||
//发系统信息
|
||||
$title = '徒弟签约到期通知';
|
||||
$content = '您的徒弟'.$user_info['nickname'].' 的签约将于48小时后到期,请及时续约。';
|
||||
model('api/UserMessage')->send_system_message($value['parent_user_id'], $title, $content, 1);
|
||||
db::name('vs_user_sign')->where('id',$value['id'])->update(['is_notice' => 1]);
|
||||
$user_sign_sed_count ++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
echo "通知签约上级徒弟48小时后到期结束 共发送". $user_sign_sed_count . "条数据"."\n";
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,15 @@ class RoomHourRanking
|
||||
$this->clear_room_offline_user();
|
||||
echo "\n";
|
||||
|
||||
echo "公会会员结算比例申请过期处理:\n";
|
||||
$this->user_ratio_up_apply_timeout();
|
||||
echo "\n";
|
||||
|
||||
|
||||
echo "通知签约上级徒弟48小时后到期:\n";
|
||||
$this->sign_notice();
|
||||
echo "\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -422,5 +431,47 @@ class RoomHourRanking
|
||||
return $result;
|
||||
}
|
||||
|
||||
//公会会员结算比例申请过期处理
|
||||
public function user_ratio_up_apply_timeout(){
|
||||
//超过24小时的数据
|
||||
$end_time = time() - 60 * 60 * 24;
|
||||
$up_count = 0;
|
||||
$guild_user_ratio_up_log = Db::name('vs_guild_user_ratio_up_log')->where(['status' => 0,'createtime' => ['<',$end_time]])->select();
|
||||
if($guild_user_ratio_up_log){
|
||||
foreach ($guild_user_ratio_up_log as $value){
|
||||
$re = Db::name('vs_guild_user_ratio_up_log')->where('id',$value['id'])->update(['status' => 2,'updatetime' => time()]);
|
||||
if($re){
|
||||
$up_count++;
|
||||
echo "处理成功:".$value['id']."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "公会会员结算比例申请过期处理结束-共". count($guild_user_ratio_up_log) . "条数据(已处理". $up_count . "条数据`)\n";
|
||||
}
|
||||
|
||||
//通知签约上级徒弟48小时后到期
|
||||
public function sign_notice(){
|
||||
$user_sign = Db::name('vs_user_sign')->where(['status' => 1,'end_time' => ['>',time()],'is_notice' => 0])->select();
|
||||
$user_sign_sed_count = 0;
|
||||
if($user_sign){
|
||||
foreach ($user_sign as $value){
|
||||
//剩余时间
|
||||
$time = $value['end_time'] - time();
|
||||
if($time < 60 * 60 * 48){
|
||||
$user_info = Db::name('user')->where('id',$value['sign_user_id'])->find();
|
||||
if($user_info){
|
||||
//发系统信息
|
||||
$title = '徒弟签约到期通知';
|
||||
$content = '您的徒弟'.$user_info['nickname'].' 的签约将于48小时后到期,请及时续约。';
|
||||
model('api/UserMessage')->send_system_message($value['parent_user_id'], $title, $content, 1);
|
||||
db::name('vs_user_sign')->where('id',$value['id'])->update(['is_notice' => 1]);
|
||||
$user_sign_sed_count ++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
echo "通知签约上级徒弟48小时后到期结束 共发送". $user_sign_sed_count . "条数据"."\n";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user