電腦版的模塊效果圖

手機(jī)版的模塊效" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

18143453325 在線咨詢 在線咨詢
18143453325 在線咨詢
所在位置: 首頁 > 營(yíng)銷資訊 > 網(wǎng)站運(yùn)營(yíng) > 類似百度文庫類的在線網(wǎng)站開發(fā)建設(shè) 第十二篇

類似百度文庫類的在線網(wǎng)站開發(fā)建設(shè) 第十二篇

時(shí)間:2023-04-29 05:51:01 | 來源:網(wǎng)站運(yùn)營(yíng)

時(shí)間:2023-04-29 05:51:01 來源:網(wǎng)站運(yùn)營(yíng)

類似百度文庫類的在線網(wǎng)站開發(fā)建設(shè) 第十二篇:前面已經(jīng)發(fā)不了不是篇章關(guān)于在線文庫網(wǎng)站項(xiàng)目的的開發(fā)建設(shè)內(nèi)容了,今天接著上面的內(nèi)容,繼續(xù)發(fā)布,希望本文章可以幫到大家的學(xué)習(xí)和使用。

電腦版的模塊效果圖

手機(jī)版的模塊效果圖

分類模塊開發(fā):


namespace app/index/controller;use app/Base;use think/App;use think/facade/Cache;use think/Request;use think/facade/View;use think/facade/Db;use app/index/model/Index as Indexmodel;use app/index/service/UserInfo as UserInfoService;class Common extends Base{ public function __construct() { parent::__construct(); $user_info = Db::name('user') ->where(['uid' => session('user')['uid']])->find(); $controller = Request()->controller(); $action = Request()->action(); $lang_all = config('console')['lang']; $array_config = Db::name('webconfig')->where(['type'=>0])->select(); $web_config = array(); foreach ($array_config as $k => $v) { $web_config[$v['code']] = $v['value']; } //首頁頂級(jí)分類展示 $cate_parent = (new Indexmodel())->geTparentCateGory(); foreach ($cate_parent as $k => $val ){ $son = Db::name('category')->where('parent_id',$val['id'])->select(); $cate_parent[$k]['son'] = $son; }// halt($cate_parent); // 首頁子分類展示 $cate_list = (new Indexmodel())->geTcateGory();// halt($cate_list); //底部文章的查詢 $article = Db::name('new')->select(); //個(gè)人信息的查詢 $user_where['uid'] = session('user')['uid']; $user_info = (new UserInfoService())->getUser($user_where); if(!empty($user_info['uid'])){ $is_login = 1; }else{ $is_login = 0; } //友情鏈接 $link = Db::name('link')->select(); // 熱門搜索 $HotSearch = Db::name('search')->order('search_number','desc')->limit(5)->select(); //系統(tǒng)處理 $articledd = Db::name('article')->where('uid',session('user')['uid'])->where('status','7')->count(); //處理失敗 $articled2 = Db::name('article')->where('uid',session('user')['uid'])->where('status','8')->count(); //待自審 $articled3 = Db::name('article')->where('uid',session('user')['uid'])->where('status','9')->count(); //后臺(tái)審核 $articled4 = Db::name('article')->where('uid',session('user')['uid'])->where('status','1')->count(); //審核被拒 $articled5 = Db::name('article')->where('uid',session('user')['uid'])->where('status','3')->count(); //已上架 $articled6 = Db::name('article')->where('uid',session('user')['uid'])->where('status','2')->count(); //已下架 $articled7 = Db::name('article')->where('uid',session('user')['uid'])->where('status','0')->count(); //我的消息 $allmsg = Db::name('notification')->alias('n')->where('n.recipient_uid',session('user')['uid'])->join(['aws_notification_data'=>'b'],'n.notification_id = b.notification_id')->where('read_flag','0')->count(); $id = session('user')['uid']; $where[] = ['recipient_uid','like',"%{$id}%"]; $mail = Db::name('webmaster_msg')->where($where)->where('read_flag','0')->count(); $countmsg = $allmsg+$mail; //企業(yè)認(rèn)證狀態(tài) $company_status =Db::name('user_company')->where('uid',session('user')['uid'])->find(); //個(gè)人認(rèn)證狀態(tài) $authentication =Db::name('user_authentication')->where('uid',session('user')['uid'])->order('a_add_time','desc')->limit(1)->select(); View::assign([ 'cate_list'=>$cate_list, 'user_info' => $user_info, 'controller' => $controller, 'action' => $action, 'lang_all'=>$lang_all, 'lang_cookie'=> cookie('think_lang'), 'user_session'=>session('user'), 'web_config'=>$web_config, 'link'=>$link, 'article'=>$article, 'cate_parent'=>$cate_parent, 'is_login' =>$is_login, 'HotSearch' => $HotSearch, 'articledd' => $articledd, 'articled2' => $articled2, 'articled3' => $articled3, 'articled4' => $articled4, 'articled5' => $articled5, 'articled6' => $articled6, 'articled7' => $articled7, 'countmsg' => $countmsg, 'company_status' => $company_status, 'authentication' => $authentication, ]); }語言包切換

public function langSwitch(){ $post = input('post.'); $lang = $post['lang']; cookie('think_lang',$lang); return 1; }驗(yàn)證手機(jī)號(hào)碼

function is_mobile($user_mobile){// $chars = "/^((/(/d{2,3}/))|(/d{3}/-))?1(3|5|8|9)/d{9}$/"; $chars = "/^0?(13|14|15|17|18)[0-9]{9}$/"; if (preg_match($chars, $user_mobile)){ return true; }else{ return false; } }猜你喜歡

public function guessLove(){ $user = Db::name('users')->orderRand() ->limit(6) ->alias('u') ->join('user_profile p', 'p.uid = u.id') ->select()->all(); $year_b = date('Y'); foreach ($user as $k => $v) { if ($v['age'] == 0) { $user[$k]['age'] = '0'; } else { $user[$k]['age'] = $year_b - $v['age']; } if(!empty($v['provinceid'])){ $address = Db::name('district')->where(['id'=>$v['provinceid']])->find(); $user[$k]['address'] = $address['text']; }else{ $user[$k]['address'] = '未填寫'; } } return json($user); }地區(qū)選擇

public function district(){ $id = input('id'); $district = Db::name('district')->where(['pid'=>$id])->select(); return json($district); } public function userAddress($provinceid = '',$cityid = '',$ereaid = ''){ $province = Db::name('district')->where(['id'=>$provinceid])->find(); $city = Db::name('district')->where(['id'=>$cityid])->find(); $area = Db::name('district')->where(['id'=>$ereaid])->find(); if(!empty($provinceid) && empty($cityid) && empty($ereaid)){ $user_address = $province['text']; }elseif(!empty($provinceid) && !empty($cityid) && empty($ereaid)){ $user_address = $province['text'].' '.$city['text']; }elseif(!empty($provinceid) && !empty($cityid) && !empty($ereaid)){ $user_address = $province['text'].' '.$city['text'].' '.$area['text']; }else{ $user_address = '未填寫'; } return $user_address; }}大家如果有什么問題,隨時(shí)可以聯(lián)系我,私聊我也是,希望這些能夠幫到大家,后面會(huì)接著繼續(xù)更新。

關(guān)鍵詞:建設(shè),文庫

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點(diǎn)擊下載Chrome瀏覽器
關(guān)閉