|
|
@@ -120,14 +120,12 @@ class HouseService
|
|
|
// 检查消耗条件
|
|
|
$checkResult = \App\Module\Game\Services\ConsumeService::checkConsume($userId, $consumeGroupId);
|
|
|
|
|
|
- if(!$checkResult['success']){
|
|
|
- throw new LogicException($checkResult['message']);
|
|
|
+ if($checkResult->error){
|
|
|
+ throw new LogicException($checkResult->message);
|
|
|
}
|
|
|
|
|
|
|
|
|
return true;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -154,12 +152,12 @@ class HouseService
|
|
|
try {
|
|
|
// 执行消耗
|
|
|
$consumeResult = \App\Module\Game\Services\ConsumeService::executeConsume($userId, $consumeGroupId, 'house_upgrade', $farmUser->id);
|
|
|
- if (!$consumeResult['success']) {
|
|
|
+ if ($consumeResult->error) {
|
|
|
\Illuminate\Support\Facades\DB::rollBack();
|
|
|
|
|
|
return [
|
|
|
'success' => false,
|
|
|
- 'message' => $consumeResult['message'] ?? '消耗材料失败',
|
|
|
+ 'message' => $consumeResult->message ?? '消耗材料失败',
|
|
|
'code' => 'CONSUME_FAILED'
|
|
|
];
|
|
|
}
|