where('type', 2)->first()->toArray(); return view('common/privacy', [ 'content' => $content['content'] ]); } //获取用户协议 public function useragreement(Request $request) { $userAgreementModel = new UserAgreement(); $content = $userAgreementModel->where('type', 1)->first()->toArray(); return view('common/privacy', [ 'content' => $content['content'] ]); } //用户反馈 public function feedback() { $adminId = \Tinywan\Jwt\JwtToken::getCurrentId(); $user = (new AdminUser)->select()->where("id", '=', $adminId)->first(); $feedback = new Feedback(); $post = request()->post(); if (empty($post["message"]) || empty($post["contact"]) || empty($adminId)) { return $this->success(dataReturn(-1, '请登录或输入完整的信息')); } $post['ip'] = get_client_ip(); $post['admin_id'] = $adminId; $post['name'] = $user['name']; $post['create_times'] = date('Y-m-d H:i:s'); if ($feedback->insertOne($post)) { return $this->success(dataReturn(0, '提交成功')); } else { return $this->success(dataReturn(-1, '系统繁忙,提交失败')); } } //修改密码 public function password() { $adminId = \Tinywan\Jwt\JwtToken::getCurrentId(); $param = request()->all(); $param['password'] = makePassword($param['new_pwd']); $param['salt'] = config('shop.salt'); unset($param['new_pwd']); unset($param['new_two_pwd']); (new AdminUser)->updateById($param, $adminId); return sparkSuccess(dataReturn(0, '修改成功')); } //系统基本信息 public function appbaseinfo() { return $this->success(dataReturn(0, '成功', [ 'base' => json_encode(getConfByType('base')), ])); } //通知公告列表 public function articlelist() { $articleModel = new Article(); $list = $articleModel->orderBy('create_time', 'desc')->limit(3)->get()->toArray(); return $this->success(dataReturn(0, '成功', [ 'list' => $list, ])); } //通知公告详情 public function articledetail() { $articleModel = new Article(); $post = request()->post(); $articledetail = $articleModel->where('id', $post['id'])->first()->toArray(); return $this->success(dataReturn(0, '成功', [ 'articledetail' => $articledetail, ])); } /** * 编辑 - 上传 电子签名 */ public function edit(Request $request) { $param = $request->all(); $id = $param['id']; // 修改这一行,使用正确的键 unset($param['children']); unset($param['org_id']); $adminUser = new AdminUser(); $adminUser->where('id', '=', $id)->update($param); return sparkSuccess(dataReturn(0, '编辑成功')); } /** * 根据id - 查询电子签名 */ public function getelectronic(Request $request) { $param = $request->all(); $adminUser = new AdminUser(); $id = $param['id'] ?? ''; $list = $adminUser->where('id', 'like', '%' . $id . '%')->select()->get(); return sparkSuccess(dataReturn(0, '查询成功', $list)); } }