Commit fa001575 authored by pengfei's avatar pengfei

update 团长分销-细化团长审核错误提示

parent 126a3371
......@@ -22,6 +22,9 @@ class MarketingException extends BaseException
const COLONEL_TAKE_PLACE_PARAMS = 31;
const COLONEL_TAKE_PLACE_FAILED = 32;
const COLONEL_APPLY_EXIST = 33;
const COLONEL_AUDIT_STATUS_USE = 34;
const COLONEL_ADD_FAILED = 35;
const COLONEL_TAKE_PLACE_EDIT_FAILED = 36;
protected $cus = [
......@@ -59,6 +62,8 @@ class MarketingException extends BaseException
self::COLONEL_TAKE_PLACE_PARAMS => '自提点信息不存在',
self::COLONEL_TAKE_PLACE_FAILED => '自提点添加失败',
self::COLONEL_APPLY_EXIST => '当前用户已提交团长申请',
self::COLONEL_AUDIT_STATUS_USE => '该团长已审核',
self::COLONEL_ADD_FAILED => '团长入库失败',
self::COLONEL_TAKE_PLACE_EDIT_FAILED => '修改团长自提点失败'
];
}
......@@ -150,7 +150,7 @@ class ColonelService
// 审核状态数据检测
$applyInfo = ColonelDistributorColonelApply::getRecord(['colonel_apply_id' => $applyId]);
if (empty($applyInfo) || $applyInfo['audit_status'] != ColonelDistributorColonelApply::STATUS_AUDIT) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS);
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_USE);
}
try {
ColonelDistributorColonelApply::beginTransaction();
......@@ -162,16 +162,16 @@ class ColonelService
// 审核成功
if ($auditStatus == ColonelDistributorColonelApply::STATUS_PASS) {
if (!self::handleAuditSuccess((array)$applyInfo)) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
throw new MarketingException(MarketingException::COLONEL_ADD_FAILED);
}
}
if (!ColonelDistributorColonelApply::commit()) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
throw new MarketingException(MarketingException::COMMIT_ERROR);
}
return true;
} catch (MarketingException $e) {
ColonelDistributorColonelApply::rollback();
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
throw new MarketingException($e->getCode());
}
}
......@@ -222,15 +222,15 @@ class ColonelService
}
// 修改自提点id
if (!ColonelDistributorColonel::updateRecord(['take_place_id' => $takePlaceId], $where)) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_FAILED);
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_EDIT_FAILED);
}
if (!ColonelDistributorColonel::commit()) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_FAILED);
throw new MarketingException(MarketingException::COMMIT_ERROR);
}
return (int)$takePlaceId;
} catch (MarketingException $e) {
ColonelDistributorColonel::rollback();
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_FAILED);
throw new MarketingException($e->getCode());
}
}
......
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