From 0208a06256b570521ba14b9ee417accf62fd6265 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Sat, 9 May 2020 17:43:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: vilson <545522390@qq.com> --- application/project/controller/Account.php | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/application/project/controller/Account.php b/application/project/controller/Account.php index bc6c897..37f3673 100644 --- a/application/project/controller/Account.php +++ b/application/project/controller/Account.php @@ -5,11 +5,16 @@ namespace app\project\controller; use app\common\Model\Member; use app\common\Model\MemberAccount; use app\common\Model\Organization; +use app\common\Model\ProjectAuth; use app\common\Model\SystemConfig; use controller\BasicApi; +use Exception; use service\FileService; use service\MessageService; use service\NodeService; +use think\db\exception\DataNotFoundException; +use think\db\exception\ModelNotFoundException; +use think\exception\DbException; use think\facade\Request; use think\File; @@ -31,7 +36,7 @@ class Account extends BasicApi /** * 账户列表 * @return array|string - * @throws \think\exception\DbException + * @throws DbException */ public function index() { @@ -94,7 +99,7 @@ class Account extends BasicApi } unset($item); } - $list['authList'] = \app\common\Model\ProjectAuth::where(['status' => '1', 'organization_code' => $currentOrganizationCode])->select(); + $list['authList'] = ProjectAuth::where(['status' => '1', 'organization_code' => $currentOrganizationCode])->select(); $this->success('', $list); } @@ -153,7 +158,7 @@ class Account extends BasicApi $this->error('该链接已失效'); } if ($inviteLink['invite_type'] == 'organization') { - $organization = \app\common\Model\Organization::where(['code' => $inviteLink['source_code']])->find(); + $organization = Organization::where(['code' => $inviteLink['source_code']])->find(); if (!$organization) { $this->error('该组织不存在'); } @@ -178,9 +183,9 @@ class Account extends BasicApi /** * 更新本团队内的头像和手机、邮箱 - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\ModelNotFoundException - * @throws \think\exception\DbException + * @throws DataNotFoundException + * @throws ModelNotFoundException + * @throws DbException */ public function _syncDetail() { @@ -200,9 +205,9 @@ class Account extends BasicApi /** * 账户添加 * @return array|string - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\ModelNotFoundException - * @throws \think\exception\DbException + * @throws DataNotFoundException + * @throws ModelNotFoundException + * @throws DbException */ public function add() { @@ -251,8 +256,8 @@ class Account extends BasicApi { try { $result = $this->model->del(Request::post('accountCode')); - } catch (\Exception $e) { - $this->error($e->getMessage(), $e->getCode());; + } catch (Exception $e) { + $this->error($e->getMessage(), $e->getCode()); } if ($result) { $this->success('', $result);