Commit 90a1496f authored by pengfei's avatar pengfei

update 是否已申请团长接口

parent fb0002b0
......@@ -44,8 +44,8 @@ class ColonelController extends Base
{
$params = $this->params;
(new ColonelCenterValidate())->validate();
$isApply = ColonelService::isApply($params['user_id']);
return $this->success(['result' => ['is_apply' => $isApply]]);
$applyInfo = ColonelService::isApply($params['user_id']);
return $this->success(['result' => $applyInfo]);
}
/**
......
......@@ -62,12 +62,15 @@ class ColonelService
* User: pengfei@yidian-inc.com
* Date: 2021/8/25 11:42 上午
* @param int $userId
* @return int
* @return array
*/
public static function isApply(int $userId): int
public static function isApply(int $userId): array
{
$isApply = ColonelDistributorColonelApply::existUser($userId);
return intval($isApply);
$applyInfo = ColonelDistributorColonelApply::getRecord(['user_id' => $userId],['colonel_apply_id','audit_status']);
return [
'is_apply' => !empty($applyInfo) ? 1 : 0,
'audit_status' => $applyInfo['audit_status']
];
}
......
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