Commit f862e8f8 authored by pengfei's avatar pengfei

update 团长分销-团长管理-异常处理

parent 688b7bcb
......@@ -49,11 +49,11 @@ class ColonelService
$colonelData['take_place_name'] = "【团长】{$colonelData['take_place_name']}";
}
if (!$applyId = ColonelDistributorColonelApply::insertRecord($colonelData)) {
throw new MarketingException(MarketingException::COLONEL_APPLY_FAILED);
throw new Exception(MarketingException::COLONEL_APPLY_FAILED);
}
return $applyId;
} catch (Exception $e) {
throw new MarketingException(MarketingException::COLONEL_APPLY_FAILED);
throw new MarketingException($e->getMessage());
}
}
......@@ -171,21 +171,21 @@ class ColonelService
['colonel_apply_id' => $applyId, 'audit_status[!]' => ColonelDistributorColonelApply::STATUS_PASS]
);
if (empty($updateStatus)) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
throw new Exception(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
}
// 审核成功
if ($auditStatus == ColonelDistributorColonelApply::STATUS_PASS) {
if (!self::handleAuditSuccess((array)$applyInfo)) {
throw new MarketingException(MarketingException::COLONEL_ADD_FAILED);
throw new Exception(MarketingException::COLONEL_ADD_FAILED);
}
}
if (!ColonelDistributorColonelApply::commit()) {
throw new MarketingException(MarketingException::COMMIT_ERROR);
throw new Exception(MarketingException::COMMIT_ERROR);
}
return true;
} catch (MarketingException $e) {
} catch (Exception $e) {
ColonelDistributorColonelApply::rollback();
throw new MarketingException($e->getCode());
throw new MarketingException($e->getMessage());
}
}
......@@ -232,19 +232,19 @@ class ColonelService
ColonelDistributorColonel::beginTransaction();
// 添加自提点
if (!$takePlaceId = TakePlaceService::add($params)) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_FAILED);
throw new Exception(MarketingException::COLONEL_TAKE_PLACE_FAILED);
}
// 修改自提点id
if (!ColonelDistributorColonel::updateRecord(['take_place_id' => $takePlaceId], $where)) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_EDIT_FAILED);
throw new Exception(MarketingException::COLONEL_TAKE_PLACE_EDIT_FAILED);
}
if (!ColonelDistributorColonel::commit()) {
throw new MarketingException(MarketingException::COMMIT_ERROR);
throw new Exception(MarketingException::COMMIT_ERROR);
}
return (int)$takePlaceId;
} catch (MarketingException $e) {
} catch (Exception $e) {
ColonelDistributorColonel::rollback();
throw new MarketingException($e->getCode());
throw new MarketingException($e->getMessage());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment