特殊的 21 22 23 任务数据处理
This commit is contained in:
@@ -16,7 +16,7 @@ class UserCp extends Model
|
||||
* @param $room_id 房间ID
|
||||
* @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空间
|
||||
$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();
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -217,12 +217,12 @@ class UserCp extends Model
|
||||
* @param $room_id 房间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 = $jinbi_arr[0];
|
||||
$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');
|
||||
$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')??'未知用户';
|
||||
|
||||
Reference in New Issue
Block a user