正在显示
7 个修改的文件
包含
85 行增加
和
28 行删除
@@ -105,8 +105,18 @@ class ArticleController extends WeChatBaseController | @@ -105,8 +105,18 @@ class ArticleController extends WeChatBaseController | ||
105 | return $this->fetch(); | 105 | return $this->fetch(); |
106 | } | 106 | } |
107 | 107 | ||
108 | + /** | ||
109 | + * 疾病信息页 | ||
110 | + * @return mixed | ||
111 | + */ | ||
108 | public function illInfo(){ | 112 | public function illInfo(){ |
109 | $illid=input('id'); | 113 | $illid=input('id'); |
114 | + $Article=new PortalPostModel(); | ||
115 | + $portalCategoryModel = new PortalCategoryModel(); | ||
116 | + $cat=$portalCategoryModel->getCategoryById($illid); | ||
117 | + $article=$Article->getArticleByCategory($illid); | ||
118 | + $this->assign('cat',$cat); | ||
119 | + $this->assign('article',$article); | ||
110 | return $this->fetch(); | 120 | return $this->fetch(); |
111 | } | 121 | } |
112 | 122 |
@@ -230,5 +230,17 @@ class PortalCategoryModel extends Model | @@ -230,5 +230,17 @@ class PortalCategoryModel extends Model | ||
230 | return $ill; | 230 | return $ill; |
231 | } | 231 | } |
232 | 232 | ||
233 | - | 233 | + /** |
234 | + * 通过id获取相应的分类 | ||
235 | + * @param $cat_id | ||
236 | + * @return array|false|\PDOStatement|string|Model | ||
237 | + * @throws \think\db\exception\DataNotFoundException | ||
238 | + * @throws \think\db\exception\ModelNotFoundException | ||
239 | + * @throws \think\exception\DbException | ||
240 | + */ | ||
241 | + public function getCategoryById($cat_id){ | ||
242 | + $map['id']=$cat_id; | ||
243 | + $cat=$this->where($map)->find(); | ||
244 | + return $cat; | ||
245 | + } | ||
234 | } | 246 | } |
@@ -379,4 +379,44 @@ class PortalPostModel extends Model | @@ -379,4 +379,44 @@ class PortalPostModel extends Model | ||
379 | ->select(); | 379 | ->select(); |
380 | return $result; | 380 | return $result; |
381 | } | 381 | } |
382 | + | ||
383 | + /** | ||
384 | + * 通过疾病类型获取文章id | ||
385 | + * @param $illId | ||
386 | + * @param string $article_type | ||
387 | + * @return mixed | ||
388 | + * @throws \think\db\exception\DataNotFoundException | ||
389 | + * @throws \think\db\exception\ModelNotFoundException | ||
390 | + * @throws \think\exception\DbException | ||
391 | + */ | ||
392 | + public function getArticleByCategory($illId,$article_type=''){ | ||
393 | + $map['category_id']=$illId; | ||
394 | + if ($article_type!=''){ | ||
395 | + $map['article_type']=$article_type; | ||
396 | + } | ||
397 | + $article_id=db('portal_category_post')->where($map)->column('post_id'); | ||
398 | + $article_id=implode(',',$article_id); | ||
399 | + $where['id']=['in',$article_id]; | ||
400 | + $where['delete_time']='0'; | ||
401 | + $article_all=$this->where($where)->select()->toArray(); | ||
402 | + foreach ($article_all as $k=>$v){ | ||
403 | + $article[$v['article_type']][]=$v; | ||
404 | + } | ||
405 | + for ($i=1;$i<5;$i++){ | ||
406 | + if (empty($article[$i])){ | ||
407 | + $article[$i]=''; | ||
408 | + } | ||
409 | + } | ||
410 | + ksort($article); | ||
411 | + return $article; | ||
412 | + } | ||
413 | + | ||
414 | + | ||
415 | + /** | ||
416 | + * 通过id获取文章内容 | ||
417 | + * @param $article | ||
418 | + */ | ||
419 | + public function getArticleById($article){ | ||
420 | + | ||
421 | + } | ||
382 | } | 422 | } |
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | </div> | 18 | </div> |
19 | </div> | 19 | </div> |
20 | <!--弹窗--> | 20 | <!--弹窗--> |
21 | - <div class="public_popup_box"> | 21 | + <div class="public_popup_box suc"> |
22 | <text>评论成功!</text> | 22 | <text>评论成功!</text> |
23 | <text>内容稍后展示出来</text> | 23 | <text>内容稍后展示出来</text> |
24 | </div> | 24 | </div> |
@@ -55,9 +55,8 @@ | @@ -55,9 +55,8 @@ | ||
55 | post:postData, | 55 | post:postData, |
56 | }, | 56 | }, |
57 | success:function(res) { | 57 | success:function(res) { |
58 | - | ||
59 | if (res.code==1){ | 58 | if (res.code==1){ |
60 | - $('.public_popup_box').show().delay(2000).hide(2) | 59 | + $('.suc').show().delay(2000).hide(2) |
61 | }else { | 60 | }else { |
62 | $('.fial').show().delay(2000).hide(2) | 61 | $('.fial').show().delay(2000).hide(2) |
63 | } | 62 | } |
@@ -55,6 +55,12 @@ | @@ -55,6 +55,12 @@ | ||
55 | <th width="100">文章类别<span class="form-required">*</span></th> | 55 | <th width="100">文章类别<span class="form-required">*</span></th> |
56 | <td> | 56 | <td> |
57 | <select name="post[article_type]" class="form-control"> | 57 | <select name="post[article_type]" class="form-control"> |
58 | + <switch name="post.article_type"> | ||
59 | + <case value="1"> <option value="1" >基础知识</option></case> | ||
60 | + <case value="2"> <option value="2" >指南知识</option></case> | ||
61 | + <case value="3"> <option value="3" >经典案例</option></case> | ||
62 | + <case value="4"> <option value="4" >质控文件</option></case> | ||
63 | + </switch> | ||
58 | <option value="1" >基础知识</option> | 64 | <option value="1" >基础知识</option> |
59 | <option value="2" >指南知识</option> | 65 | <option value="2" >指南知识</option> |
60 | <option value="3" >经典案例</option> | 66 | <option value="3" >经典案例</option> |
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | </head> | 11 | </head> |
12 | <body> | 12 | <body> |
13 | <header class="banner_box"> | 13 | <header class="banner_box"> |
14 | - <img src="__TMPL__/public/assets/images/abg01@2x.png" alt=""> | 14 | + <img src="{:cmf_get_image_url($cat.more.thumbnail)}" alt=""> |
15 | </header> | 15 | </header> |
16 | <!--内容部分--> | 16 | <!--内容部分--> |
17 | <div class="content_box"> | 17 | <div class="content_box"> |
@@ -22,36 +22,27 @@ | @@ -22,36 +22,27 @@ | ||
22 | <div class="tab_title">质控文件</div> | 22 | <div class="tab_title">质控文件</div> |
23 | </div> | 23 | </div> |
24 | <div> | 24 | <div> |
25 | - <div class="tab_content1" > | 25 | + <volist name="article" id="v" key="key1"> |
26 | + <div class="tab_content1 <if condition="$key1!=1">item </if>" > | ||
27 | + <volist name="v" id="vo" key="key2" empty="内容为空"> | ||
28 | + <a href="{:url('portal/article/index',['id'=>$vo.id])}"> | ||
26 | <div class="item_box"> | 29 | <div class="item_box"> |
27 | <div> | 30 | <div> |
28 | - <div class="item_title">人参一斤 不如糙米一升1</div> | ||
29 | - <div class="item_content">精致,是一种对生活热爱且认真负责的态度。如今人们在选择食物的时候...精致,是一种对生活热爱且认真负责的态度。如今人们在选择食物的时候...</div> | ||
30 | - <div>2018.08.15</div> | 31 | + <div class="item_title">{$vo.post_title}</div> |
32 | + <div class="item_content">{:getDescirpe($vo.post_content)}...</div> | ||
33 | + <div>{:date('Y.m.d',$vo.create_time)}</div> | ||
31 | </div> | 34 | </div> |
32 | <div> | 35 | <div> |
33 | - <img src="__TMPL__/public/assets/images/dpic06@2x.png" alt=""> | ||
34 | - </div> | ||
35 | - </div> | ||
36 | - <div class="item_box"> | ||
37 | - <div> | ||
38 | - <div class="item_title">人参一斤 不如糙米一升1</div> | ||
39 | - <div class="item_content">精致,是一种对生活热爱且认真负责的态度。如今人们在选择食物的时候...精致,是一种对生活热爱且认真负责的态度。如今人们在选择食物的时候...</div> | ||
40 | - <div>2018.08.15</div> | ||
41 | - </div> | ||
42 | - <div> | ||
43 | - <img src="__TMPL__/public/assets/images/dpic06@2x.png" alt=""> | 36 | + <img src="{:cmf_get_image_preview_url($vo.more.thumbnail)}" alt=""> |
44 | </div> | 37 | </div> |
38 | + | ||
45 | </div> | 39 | </div> |
40 | + </a> | ||
41 | + </volist> | ||
46 | </div> | 42 | </div> |
47 | - <div class="tab_content1 item"> | ||
48 | - | ||
49 | - </div> | ||
50 | - | ||
51 | - <div class="tab_content1 item"> | 43 | +</volist> |
52 | 44 | ||
53 | - </div> | ||
54 | - </div> | 45 | +</div> |
55 | 46 | ||
56 | </div> | 47 | </div> |
57 | 48 |
-
请 注册 或 登录 后发表评论