|
|
|
@ -98,7 +98,8 @@ class Apply extends ApplyModel |
|
|
|
|
$userId = UserService::getCurrentLoginUserId(); |
|
|
|
|
// 成为分销商条件 |
|
|
|
|
$config = Setting::getItem('condition'); |
|
|
|
|
if ($this->where(['user_id' => $userId])->exists()) { |
|
|
|
|
$info = self::get(['user_id' => $userId]); |
|
|
|
|
if (!empty($info)) { |
|
|
|
|
throwError('您已申请服务商,请勿重复提交'); |
|
|
|
|
} |
|
|
|
|
// 数据整理 |
|
|
|
@ -135,7 +136,7 @@ class Apply extends ApplyModel |
|
|
|
|
// 当前用户ID |
|
|
|
|
$userId = UserService::getCurrentLoginUserId(); |
|
|
|
|
$info = self::get(['user_id' => $userId]); |
|
|
|
|
if ($info->isEmpty()) { |
|
|
|
|
if (empty($info)) { |
|
|
|
|
throwError('申请记录不存在'); |
|
|
|
|
} |
|
|
|
|
$info = $info->toArray(); |
|
|
|
@ -151,11 +152,23 @@ class Apply extends ApplyModel |
|
|
|
|
'business' => $data['business'], |
|
|
|
|
'city' => $data['city'], |
|
|
|
|
]; |
|
|
|
|
$res = $this->where(['user_id' => $userId])->update($data); |
|
|
|
|
if ($res->getError()) { |
|
|
|
|
return false; |
|
|
|
|
if ($this->update($data, ['user_id' => $userId])) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @notes:申请记录详情 |
|
|
|
|
* @return Apply|array|null |
|
|
|
|
* @throws BaseException |
|
|
|
|
* @author: wanghousheng |
|
|
|
|
*/ |
|
|
|
|
public function getApplyInfo() |
|
|
|
|
{ |
|
|
|
|
// 当前用户ID |
|
|
|
|
$userId = UserService::getCurrentLoginUserId(); |
|
|
|
|
return self::get(['user_id' => $userId]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|