<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Niushop開源商城后臺表單 --- **niushop后臺表單原理** 1. 添加信息表單 2. niushop后臺配置添加修改數據與頁面用一個控制器方法,方便管理權限 3. 控制器一般不能調用model直接操作數據,而是調用data/service下面對應的服務層方法 4. 返回數據用ajaxReturn函數對數據處理 5. 加載頁面用$this-&gt;style樣式 ```php /** * 添加文章 */ public function addArticle() { $article = new Article(); //niushop后臺配置添加修改數據與頁面用一個控制器方法,方便管理權限 if (request()->isAjax()) { $title = request()->post('title', ''); $class_id = request()->post('class_id', ''); $short_title = request()->post('short_title', ''); $source = request()->post('source', ''); $url = request()->post('url', ''); $author = request()->post('author', ''); $summary = request()->post('summary', ''); $content = request()->post('content', ''); $image = request()->post('image', ''); $keyword = request()->post('keyword', ''); $article_id_array = request()->post('article_id_array', ''); $click = request()->post('click', ''); $sort = request()->post('sort', ''); $commend_flag = request()->post('commend_flag', ''); $comment_flag = request()->post('comment_flag', ''); $attachment_path = request()->post('attachment_path', ''); $tag = request()->post('tag', ''); $comment_count = request()->post('comment_count', ''); $share_count = request()->post('share_count', ''); $status = 2; $data = array( 'title' => $title, 'class_id' => $class_id, 'short_title' => $short_title, 'source' => $source, 'url' => $url, 'author' => $author, 'summary' => $summary, 'content' => $content, 'image' => $image, 'keyword' => $keyword, 'article_id_array' => $article_id_array, 'click' => $click, 'sort' => $sort, 'commend_flag' => $commend_flag, 'comment_flag' => $comment_flag, 'status' => $status, 'attachment_path' => $attachment_path, 'tag' => $tag, 'comment_count' => $comment_count, 'share_count' => $share_count, 'uid' => $this->uid, 'public_time' => time(), 'create_time' => time() ); //控制器一般不能調用model直接操作數據,而是調用data/service下面對應的服務層方法 $result = $article->addArticle($data); //返回數據用ajaxReturn函數對數據處理 return AjaxReturn($result); } else { $articleClassList = $article->getArticleClass(); $this->assign('articleClassList', $articleClassList); return view($this->style . 'Cms/addArticle'); } } ``` ```js var flag = false;//防止重復提交 function save(type){ if(!validation()){ return; } var comment_flag = $("#comment_flag").prop('checked') ? 1 : 0 ; var commend_flag = $("#commend_flag").prop('checked') ? 1 : 0 ; var title=$("#title").val(); var class_id=$("#class_id").val(); var short_title=$("#short_title").val(); var source=$("#source").val(); var url=$("#url").val(); var author=$("#author").val(); var summary=$("#summary").val(); var content = UE.getEditor('editor').getContent(); if(content.length>65535){ showTip("文章內容太長","warning"); return; } var image=$("#title_img").val(); var keyword=$("#keyword").val(); var article_id_array=$("#article_id_array").val(); var click=$("#click").val(); var sort=$("#sort").val(); var tag=$("#tag").val(); var comment_count=$("#comment_count").val(); var share_count=$("#share_count").val(); var attachment_path = $("#attachment").val(); if(flag) return; flag = true; $.ajax({ type:"post", url:"{:__URL('ADMIN_MAIN/Cms/addArticle')}", data:{ 'title':title, 'class_id':class_id, 'short_title':short_title, 'source':source, 'url':url, 'author':author, 'summary':summary, 'content':content, 'image':image, 'keyword':keyword, 'article_id_array':article_id_array, 'click':click, 'sort':sort, 'commend_flag':commend_flag, 'comment_flag':comment_flag, 'attachment_path':attachment_path, 'tag':tag, 'comment_count':comment_count, 'share_count':share_count }, success:function(data){ if (data["code"] > 0) { showTip(data["message"],'success'); if(type==1){ location.href=__URL("ADMIN_MAIN/cms/articlelist"); } if(type==2){ window.open(__URL("SHOP_MAIN/article/detail?article_id="+data['code'])); } }else{ showTip(data["message"],'error'); flag = false; } } }); } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看