|
|
@@ -915,18 +915,18 @@ class User extends AuthController
|
|
|
{
|
|
|
$user = \app\models\user\User::getUserInfo($uid);
|
|
|
$ratio = $this->request->post('ratio', 0);
|
|
|
- if (!$mid || !MiningMachine::get($mid)) return app('json')->fail('矿机不合法');
|
|
|
+ if (!$mid || !MiningMachine::get($mid)) Json::fail('矿机不合法');
|
|
|
$self = UserMiningService::where('mid', $mid)->where('uid', $user['spread_uid'])->find();
|
|
|
if ($user['spread_uid'] && (!isset($self['ratio']) || $ratio < $self['ratio'])) {
|
|
|
- return app('json')->fail('服务费比例不能低于目标上级');
|
|
|
+ Json::('服务费比例不能低于目标上级');
|
|
|
}
|
|
|
$uids = \app\models\user\User::where('spread_uid', $user['uid'])->column('uid');
|
|
|
$user2 = UserMiningService::where('mid', $mid)->where('uid', 'in', $uids)->min('ratio');
|
|
|
if ($user2 > 0 && $ratio > $user2) {
|
|
|
- return app('json')->fail('服务费比例不能高于目标下级');
|
|
|
+ Json::('服务费比例不能高于目标下级');
|
|
|
}
|
|
|
if ($ratio > MiningMachine::where('id', $mid)->value('service_ratio')) {
|
|
|
- return app('json')->fail('服务费比例不能高于系统设置');
|
|
|
+ Json::('服务费比例不能高于系统设置');
|
|
|
}
|
|
|
if (UserMiningService::where('mid', $mid)->where('uid', $uid)->find()) {
|
|
|
$res = UserMiningService::where('mid', $mid)->where('uid', $uid)
|
|
|
@@ -942,9 +942,9 @@ class User extends AuthController
|
|
|
]);
|
|
|
}
|
|
|
if ($res) {
|
|
|
- return app('json')->success('修改成功');
|
|
|
+ Json::success('修改成功');
|
|
|
} else {
|
|
|
- return app('json')->fail('修改失败或者您没有修改什么');
|
|
|
+ Json::fail('修改失败或者您没有修改什么');
|
|
|
}
|
|
|
}
|
|
|
}
|