field('title,content')->where($map)->find(); if (empty($page_info)) { // return ['code' => 201, 'msg' => '信息不存在', 'data' => null]; return json(['code' => 201, 'msg' => '信息不存在', 'data' => null]); } $page_info['content'] = $this->getImgAllSrc($page_info['content']); $this->assign('data', $page_info); return $this->view->fetch(); } //邀请二维码 public function invitation() { $uid = input('uid', 0); $user_info = db::name('user')->where(['uid' => $uid])->field('uid,reg_code,reg_code_path')->find(); if (empty($user_info)) { // return ['code' => 200, 'msg' => '信息不存在', 'data' => null]; return json(['code' => 201, 'msg' => '信息不存在', 'data' => null]); } if (empty($user_info['reg_code_path'])) { // $user_info['reg_code_path'] = model('Api/User')->get_user_reg_qrcode($user_info['uid']); $data=model('api/User')->get_user_reg_qrcode($user_info['uid']); $user_info['reg_code_path'] =$data['data']; } $user_info['qrcode'] = localpath_to_netpath($user_info['reg_code_path']); // $this->assign('qrcode', $user_info['reg_code_path']); $this->assign('qrcode',$user_info['qrcode']); $this->assign('reg_code', $user_info['reg_code']); return $this->fetch(); } //注册页 public function register() { return $this->fetch(); } public function getImgAllSrc($tag) { $preg = "//"; $style = "width: 100%"; $img = '$1'; $data = preg_replace($preg,$img,$tag); return $data; } }