diff --git a/application/project/controller/Account.php b/application/project/controller/Account.php index c0a405f..bc6c897 100644 --- a/application/project/controller/Account.php +++ b/application/project/controller/Account.php @@ -176,6 +176,27 @@ class Account extends BasicApi $this->success('', ['organizationList' => $organizationList, 'currentOrganization' => $organization]); } + /** + * 更新本团队内的头像和手机、邮箱 + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + */ + public function _syncDetail() + { + $code = Request::post('code'); + $memberAccount = $this->model->where(['code' => $code])->find(); + $memberInfo = Member::where('code', $memberAccount['member_code'])->find(); + if (!$memberInfo) { + $this->error("更新失败!"); + } + $memberAccount->avatar = $memberInfo['avatar']; + !$memberAccount->mobile && $memberAccount->mobile = $memberInfo['mobile']; + !$memberAccount->email && $memberAccount->email = $memberInfo['email']; + $memberAccount->save(); + $this->success('更新成功'); + } + /** * 账户添加 * @return array|string