|
@@ -81,22 +81,22 @@ class UserMiningMachine extends BaseModel
|
|
|
|
|
|
if (time() > $v['third_step_start_time']) {
|
|
|
|
|
|
- $send_stand = bcdiv($v['stand_money'], $machine['third_step_time'], 3);
|
|
|
+ $send_stand = bcdiv($v['stand_money'], $machine['third_step_time'], 8);
|
|
|
$day_unlock = 0;
|
|
|
$locks = UserMining::where('umid', $v['id'])->where('add_date', '<>', strtotime('Y-m-d'))->where('lock_money', '>', 0)->select();
|
|
|
foreach ($locks as $vv) {
|
|
|
if ($vv['lock_money'] >= $vv['day_unlock_money']) {
|
|
|
- $day_unlock = bcadd($day_unlock, $vv['day_unlock_money'], 3);
|
|
|
+ $day_unlock = bcadd($day_unlock, $vv['day_unlock_money'], 8);
|
|
|
UserMining::where('id', $vv['id'])->dec('lock_money', $vv['day_unlock_money'])->update();
|
|
|
} else {
|
|
|
- $day_unlock = bcadd($day_unlock, $vv['lock_money'], 3);
|
|
|
+ $day_unlock = bcadd($day_unlock, $vv['lock_money'], 8);
|
|
|
UserMining::where('id', $vv['id'])->dec('lock_money', $vv['lock_money'])->update();
|
|
|
}
|
|
|
}
|
|
|
- if (bcadd($send_stand, $day_unlock, 3)) {
|
|
|
+ if (bcadd($send_stand, $day_unlock, 8)) {
|
|
|
$res = $res && UserMining::create([
|
|
|
'umid' => $v['id'],
|
|
|
- 'get_money' => bcadd($send_stand, $day_unlock, 3),
|
|
|
+ 'get_money' => bcadd($send_stand, $day_unlock, 8),
|
|
|
'get_money_type' => $v['get_money_type'],
|
|
|
'add_time' => time(),
|
|
|
'add_date' => date('Y-m-d'),
|
|
@@ -115,43 +115,43 @@ class UserMiningMachine extends BaseModel
|
|
|
$locks = UserMining::where('umid', $v['id'])->where('add_date', '<>', strtotime('Y-m-d'))->where('lock_money', '>', 0)->select();
|
|
|
foreach ($locks as $vv) {
|
|
|
if ($vv['lock_money'] >= $vv['day_unlock_money']) {
|
|
|
- $day_unlock = bcadd($day_unlock, $vv['day_unlock_money'], 3);
|
|
|
+ $day_unlock = bcadd($day_unlock, $vv['day_unlock_money'], 8);
|
|
|
UserMining::where('id', $vv['id'])->dec('lock_money', $vv['day_unlock_money'])->update();
|
|
|
} else {
|
|
|
- $day_unlock = bcadd($day_unlock, $vv['lock_money'], 3);
|
|
|
+ $day_unlock = bcadd($day_unlock, $vv['lock_money'], 8);
|
|
|
UserMining::where('id', $vv['id'])->dec('lock_money', $vv['lock_money'])->update();
|
|
|
}
|
|
|
}
|
|
|
- $day_get = bcmul($machine['day_get'] > 0 ? $machine['day_get'] : $day_gets[$machine['get_money_type']], $v['num'], 3);
|
|
|
- $day_get = bcmul($day_get, 0.9, 3);
|
|
|
+ $day_get = bcmul($machine['day_get'] > 0 ? $machine['day_get'] : $day_gets[$machine['get_money_type']], $v['num'], 8);
|
|
|
+ $day_get = bcmul($day_get, 0.9, 8);
|
|
|
$service_ratio = bcsub(1, bcdiv($machine['service_ratio'], 100, 4), 4);
|
|
|
- $day_service_get = bcmul($service_ratio, $day_get, 3);
|
|
|
+ $day_service_get = bcmul($service_ratio, $day_get, 8);
|
|
|
$second_step_get_ratio = bcdiv($machine['second_step_get_ratio'], 100, 4);
|
|
|
- $day_real_get = bcmul($second_step_get_ratio, $day_service_get, 3);
|
|
|
- $day_lock = bcsub($day_service_get, $day_real_get, 3);
|
|
|
+ $day_real_get = bcmul($second_step_get_ratio, $day_service_get, 8);
|
|
|
+ $day_lock = bcsub($day_service_get, $day_real_get, 8);
|
|
|
if ($day_real_get > 0) {
|
|
|
$res = $res && UserMining::create([
|
|
|
'umid' => $v['id'],
|
|
|
- 'get_money' => bcadd($day_real_get, $day_unlock, 3),
|
|
|
+ 'get_money' => bcadd($day_real_get, $day_unlock, 8),
|
|
|
'get_money_type' => $v['get_money_type'],
|
|
|
'add_time' => time(),
|
|
|
'add_date' => date('Y-m-d'),
|
|
|
'lock_money' => $day_lock,
|
|
|
- 'day_unlock_money' => bcdiv($day_lock, $machine['third_step_time'], 3),
|
|
|
- ]) && UserMoney::incomeMoney($v['uid'], $v['get_money_type'], bcadd($day_real_get, $day_unlock, 3), 'mining', '挖矿', '第二阶段每日释放' . $day_get . init_money_type()[$v['get_money_type']] . ',扣除技术服务费后实际到账' . $day_real_get . init_money_type()[$v['get_money_type']] . ($day_lock > 0 ? ',锁定' . $day_lock . init_money_type()[$v['get_money_type']] : '') . ($day_unlock > 0 ? ',解锁第二阶段锁定金' . $day_unlock . init_money_type()[$v['get_money_type']] : ''))
|
|
|
- && self::sendGroupAward($v['uid'], $v['get_money_type'], bcadd($day_real_get, $day_unlock, 3))
|
|
|
- && self::sendSystemAward($v['uid'], $v['get_money_type'], bcadd($day_real_get, $day_unlock, 3));
|
|
|
+ 'day_unlock_money' => bcdiv($day_lock, $machine['third_step_time'], 8),
|
|
|
+ ]) && UserMoney::incomeMoney($v['uid'], $v['get_money_type'], bcadd($day_real_get, $day_unlock, 8), 'mining', '挖矿', '第二阶段每日释放' . $day_get . init_money_type()[$v['get_money_type']] . ',扣除技术服务费后实际到账' . $day_real_get . init_money_type()[$v['get_money_type']] . ($day_lock > 0 ? ',锁定' . $day_lock . init_money_type()[$v['get_money_type']] : '') . ($day_unlock > 0 ? ',解锁第二阶段锁定金' . $day_unlock . init_money_type()[$v['get_money_type']] : ''))
|
|
|
+ && self::sendGroupAward($v['uid'], $v['get_money_type'], bcadd($day_real_get, $day_unlock, 8))
|
|
|
+ && self::sendSystemAward($v['uid'], $v['get_money_type'], bcadd($day_real_get, $day_unlock, 8));
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
- $day_get = bcmul($machine['day_get'] > 0 ? $machine['day_get'] : $day_gets[$machine['get_money_type']], $v['num'], 3);
|
|
|
+ $day_get = bcmul($machine['day_get'] > 0 ? $machine['day_get'] : $day_gets[$machine['get_money_type']], $v['num'], 8);
|
|
|
|
|
|
- $day_get = bcmul($day_get, 0.9, 3);
|
|
|
+ $day_get = bcmul($day_get, 0.9, 8);
|
|
|
$service_ratio = bcsub(1, bcdiv($machine['service_ratio'], 100, 4), 4);
|
|
|
- $day_service_get = bcmul($service_ratio, $day_get, 3);
|
|
|
+ $day_service_get = bcmul($service_ratio, $day_get, 8);
|
|
|
$first_step_get_ratio = bcdiv($machine['first_step_get_ratio'], 100, 4);
|
|
|
- $day_real_get = bcmul($first_step_get_ratio, $day_service_get, 3);
|
|
|
- $day_stand = bcsub($day_service_get, $day_real_get, 3);
|
|
|
+ $day_real_get = bcmul($first_step_get_ratio, $day_service_get, 8);
|
|
|
+ $day_stand = bcsub($day_service_get, $day_real_get, 8);
|
|
|
|
|
|
|
|
|
if ($day_real_get > 0) {
|
|
@@ -161,9 +161,9 @@ class UserMiningMachine extends BaseModel
|
|
|
'get_money_type' => $v['get_money_type'],
|
|
|
'add_time' => time(),
|
|
|
'add_date' => date('Y-m-d'),
|
|
|
- ]) && UserMoney::incomeMoney($v['uid'], $v['get_money_type'], bcadd($day_real_get, 0, 3), 'mining', '挖矿', '第一阶段每日释放' . $day_get . init_money_type()[$v['get_money_type']] . ',扣除技术服务费后实际到账' . $day_real_get . init_money_type()[$v['get_money_type']] . ($day_stand > 0 ? ',质押' . $day_stand . init_money_type()[$v['get_money_type']] : ''))
|
|
|
- && self::sendGroupAward($v['uid'], $v['get_money_type'], bcadd($day_real_get, 0, 3))
|
|
|
- && self::sendSystemAward($v['uid'], $v['get_money_type'], bcadd($day_real_get, 0, 3));
|
|
|
+ ]) && UserMoney::incomeMoney($v['uid'], $v['get_money_type'], bcadd($day_real_get, 0, 8), 'mining', '挖矿', '第一阶段每日释放' . $day_get . init_money_type()[$v['get_money_type']] . ',扣除技术服务费后实际到账' . $day_real_get . init_money_type()[$v['get_money_type']] . ($day_stand > 0 ? ',质押' . $day_stand . init_money_type()[$v['get_money_type']] : ''))
|
|
|
+ && self::sendGroupAward($v['uid'], $v['get_money_type'], bcadd($day_real_get, 0, 8))
|
|
|
+ && self::sendSystemAward($v['uid'], $v['get_money_type'], bcadd($day_real_get, 0, 8));
|
|
|
}
|
|
|
if ($day_stand > 0) {
|
|
|
$res = $res && self::where('id', $v['id'])->inc('stand_money', $day_stand)->update();
|
|
@@ -193,10 +193,10 @@ class UserMiningMachine extends BaseModel
|
|
|
if ($ratio <= 0) {
|
|
|
$spread = User::getUserInfo($spread['spread_uid']);
|
|
|
} else {
|
|
|
- $brokerage = bcmul($num, bcdiv($ratio, 100, 4), 5);
|
|
|
- if (bcsub($brokerage, $send, 5) > 0) {
|
|
|
+ $brokerage = bcmul($num, bcdiv($ratio, 100, 4), 8);
|
|
|
+ if (bcsub($brokerage, $send, 8) > 0) {
|
|
|
$v = UserLevel::getUserLevelInfo(UserLevel::getUserLevel($spread['uid']), 'level_id');
|
|
|
- $res = $res && UserMoney::incomeMoney($spread['uid'], $money_type, bcsub($brokerage, $send, 5), 'group_create_brokerage', '分享算力', '获得分享算力V' . $v . ':' . $user['nickname'] . '(' . $user['uid'] . ')' . '今日矿机收益分红(' . $ratio . '%×' . $num . ')减去已发放级差' . $send . ',合计' . bcsub($brokerage, $send, 5) . init_money_type()[$money_type]);
|
|
|
+ $res = $res && UserMoney::incomeMoney($spread['uid'], $money_type, bcsub($brokerage, $send, 8), 'group_create_brokerage', '分享算力', '获得分享算力V' . $v . ':' . $user['nickname'] . '(' . $user['uid'] . ')' . '今日矿机收益分红(' . $ratio . '%×' . $num . ')减去已发放级差' . $send . ',合计' . bcsub($brokerage, $send, 8) . init_money_type()[$money_type]);
|
|
|
}
|
|
|
$send = $brokerage;
|
|
|
$spread = User::getUserInfo($spread['spread_uid']);
|
|
@@ -210,7 +210,7 @@ class UserMiningMachine extends BaseModel
|
|
|
$user = User::getUserInfo($uid);
|
|
|
$ratio = sys_config('system_create_award_ratio', 0);
|
|
|
if (!$ratio) return true;
|
|
|
- $brokerage = bcmul($num, bcdiv($ratio, 100, 4), 5);
|
|
|
+ $brokerage = bcmul($num, bcdiv($ratio, 100, 4), 8);
|
|
|
if ($brokerage <= 0) return true;
|
|
|
$users = UserLevel::valiWhere()->where(function ($query) {
|
|
|
$query->where('is_forever', 1)->whereOr('valid_time', '>', time());
|
|
@@ -222,7 +222,7 @@ class UserMiningMachine extends BaseModel
|
|
|
}
|
|
|
$res = true;
|
|
|
if (count($users) > 0)
|
|
|
- $brokerage = bcdiv($brokerage, count($users), 5);
|
|
|
+ $brokerage = bcdiv($brokerage, count($users), 8);
|
|
|
else
|
|
|
$brokerage = 0;
|
|
|
if ($brokerage > 0) {
|