特殊的 21 22 23 任务数据处理
This commit is contained in:
@@ -530,7 +530,7 @@ class GiveGift extends Model
|
|||||||
model('DailyTasks')->tasks_complete($uid,3);
|
model('DailyTasks')->tasks_complete($uid,3);
|
||||||
}
|
}
|
||||||
//cp检测且处理升级事宜
|
//cp检测且处理升级事宜
|
||||||
$cp_type = model('api/UserCp')->checkGift($uid, $gid, $to_id, $from_id, $num);//0-不处理,1-表明心意,2-组成Cp
|
$cp_type = model('api/UserCp')->checkGift($uid, $gid, $to_id, $from_id, $num,$gift_price);//0-不处理,1-表明心意,2-组成Cp
|
||||||
if($cp_type == 1){
|
if($cp_type == 1){
|
||||||
$textt1 = "亲爱的用户,您好!\n".$FromUserInfo['nickname'] . ' 的 【' .$gift_info['gift_name'].' 】 已送达,这是他的心动信号。回赠一个,即可锁定这份缘分!';
|
$textt1 = "亲爱的用户,您好!\n".$FromUserInfo['nickname'] . ' 的 【' .$gift_info['gift_name'].' 】 已送达,这是他的心动信号。回赠一个,即可锁定这份缘分!';
|
||||||
$textt = '';
|
$textt = '';
|
||||||
@@ -826,7 +826,7 @@ class GiveGift extends Model
|
|||||||
model('DailyTasks')->tasks_complete($uid,3);
|
model('DailyTasks')->tasks_complete($uid,3);
|
||||||
}
|
}
|
||||||
//cp检测
|
//cp检测
|
||||||
model('api/UserCp')->checkGift($uid, $gid, $to_id, $from_id,$num);
|
model('api/UserCp')->checkGift($uid, $gid, $to_id, $from_id,$num,$gift_price);
|
||||||
}
|
}
|
||||||
|
|
||||||
//增加房间火热值hot_value
|
//增加房间火热值hot_value
|
||||||
|
|||||||
@@ -3280,7 +3280,7 @@ class Room extends Model
|
|||||||
|
|
||||||
|
|
||||||
//任务跳转房间推荐
|
//任务跳转房间推荐
|
||||||
public function task_jump_room_recommend($task_id)
|
public function task_jump_room_recommend($task_id,$user_id)
|
||||||
{
|
{
|
||||||
if($task_id == 6 || $task_id == 16){
|
if($task_id == 6 || $task_id == 16){
|
||||||
//签约房间
|
//签约房间
|
||||||
@@ -3326,8 +3326,16 @@ class Room extends Model
|
|||||||
if(!$room_ids){
|
if(!$room_ids){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//在上面获取 一个随义的id
|
|
||||||
return $room_ids[array_rand($room_ids)];
|
//获取徒弟是否在房间内
|
||||||
|
$roomId = db::name('vs_room_visitor')->where('user_id',$user_id)->order('id desc')->value('room_id');
|
||||||
|
if($roomId){
|
||||||
|
//在上面获取 一个随义的id
|
||||||
|
return $room_ids[array_rand($room_ids)];
|
||||||
|
}else{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if($task_id == 22){
|
if($task_id == 22){
|
||||||
//拍卖 且有人有热度
|
//拍卖 且有人有热度
|
||||||
@@ -3337,8 +3345,14 @@ class Room extends Model
|
|||||||
if(!$room_ids){
|
if(!$room_ids){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//在上面获取 一个随义的id
|
//获取徒弟是否在房间内
|
||||||
return $room_ids[array_rand($room_ids)];
|
$roomId = db::name('vs_room_visitor')->where('user_id',$user_id)->order('id desc')->value('room_id');
|
||||||
|
if($roomId){
|
||||||
|
//在上面获取 一个随义的id
|
||||||
|
return $room_ids[array_rand($room_ids)];
|
||||||
|
}else{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($task_id == 23){
|
if($task_id == 23){
|
||||||
//拍卖 且有人有热度
|
//拍卖 且有人有热度
|
||||||
@@ -3348,8 +3362,14 @@ class Room extends Model
|
|||||||
if(!$room_ids){
|
if(!$room_ids){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//在上面获取 一个随义的id
|
//获取徒弟是否在房间内
|
||||||
return $room_ids[array_rand($room_ids)];
|
$roomId = db::name('vs_room_visitor')->where('user_id',$user_id)->order('id desc')->value('room_id');
|
||||||
|
if($roomId){
|
||||||
|
//在上面获取 一个随义的id
|
||||||
|
return $room_ids[array_rand($room_ids)];
|
||||||
|
}else{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(in_array($task_id, [7,8,13,14,18,19,20])){
|
if(in_array($task_id, [7,8,13,14,18,19,20])){
|
||||||
//抽奖
|
//抽奖
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class UserCp extends Model
|
|||||||
* @param $room_id 房间ID
|
* @param $room_id 房间ID
|
||||||
* @return int 0-无,1-等待回应,2-已建立Cp空间
|
* @return int 0-无,1-等待回应,2-已建立Cp空间
|
||||||
*/
|
*/
|
||||||
public function checkGift($from_user_id, $gift_id, $to_user_id, $room_id, $num)
|
public function checkGift($from_user_id, $gift_id, $to_user_id, $room_id, $num,$gift_price)
|
||||||
{
|
{
|
||||||
//查询是否已经存在Cp空间
|
//查询是否已经存在Cp空间
|
||||||
$rees = Db::name('user_cp_zone')->where(['user_id1' => $from_user_id,'user_id2' => $to_user_id,'status' => 1])->find();
|
$rees = Db::name('user_cp_zone')->where(['user_id1' => $from_user_id,'user_id2' => $to_user_id,'status' => 1])->find();
|
||||||
@@ -24,7 +24,7 @@ class UserCp extends Model
|
|||||||
$rees = Db::name('user_cp_zone')->where(['user_id1' => $to_user_id,'user_id2' => $from_user_id,'status' => 1])->find();
|
$rees = Db::name('user_cp_zone')->where(['user_id1' => $to_user_id,'user_id2' => $from_user_id,'status' => 1])->find();
|
||||||
}
|
}
|
||||||
if($rees){
|
if($rees){
|
||||||
$this->addCpLevel($from_user_id, $to_user_id, $room_id, $gift_id, $rees['id'], $num);
|
$this->addCpLevel($from_user_id, $to_user_id, $room_id, $gift_id, $rees['id'], $num,$gift_price);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,12 +217,12 @@ class UserCp extends Model
|
|||||||
* @param $room_id 房间ID
|
* @param $room_id 房间ID
|
||||||
* @param $cp_zone_id Cp空间ID
|
* @param $cp_zone_id Cp空间ID
|
||||||
*/
|
*/
|
||||||
public function addCpLevel($from_user_id, $to_user_id, $room_id, $gift_id, $cp_zone_id, $num)
|
public function addCpLevel($from_user_id, $to_user_id, $room_id, $gift_id, $cp_zone_id, $num,$gift_price)
|
||||||
{
|
{
|
||||||
$jinbi_arr = explode(',', get_system_config_value('cp_exp_rate'));
|
$jinbi_arr = explode(',', get_system_config_value('cp_exp_rate'));
|
||||||
$jinbi = $jinbi_arr[0];
|
$jinbi = $jinbi_arr[0];
|
||||||
$jinyan = $jinbi_arr[1];
|
$jinyan = $jinbi_arr[1];
|
||||||
$exp = round(db::name('vs_gift')->where(['gid' => $gift_id])->value('gift_price') * $num / $jinbi * $jinyan, 2);
|
$exp = round($gift_price * $num / $jinbi * $jinyan, 2);
|
||||||
$yuan_exp = Db::name('user_cp_zone')->where(['id' => $cp_zone_id])->value('exp');
|
$yuan_exp = Db::name('user_cp_zone')->where(['id' => $cp_zone_id])->value('exp');
|
||||||
$zone_level = Db::name('user_cp_zone')->where(['id' => $cp_zone_id])->value('level');
|
$zone_level = Db::name('user_cp_zone')->where(['id' => $cp_zone_id])->value('level');
|
||||||
$toUserNickname =db::name('user')->where(['id' => $to_user_id])->value('nickname')??'未知用户';
|
$toUserNickname =db::name('user')->where(['id' => $to_user_id])->value('nickname')??'未知用户';
|
||||||
|
|||||||
Reference in New Issue
Block a user