ArticleIntro.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. // 图文
  5. class ArticleIntro extends Model
  6. {
  7. public function itemList(){
  8. return $this->hasMany('ArticleItem','article_id')
  9. ->where('is_deleted',0)
  10. ->where('status',1)
  11. ->where('release_time','< time',date("Y-m-d H:i:s"))
  12. ->field('id,release_time,article_id,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
  13. // ->order('sort desc,read_num desc');
  14. }
  15. public function itemList3(){
  16. return $this->hasMany('ArticleItem','article_id')
  17. ->where('is_deleted',0)
  18. ->where('release_time','< time',date("Y-m-d H:i:s"))
  19. ->field('id,article_id,release_time,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
  20. // ->order('sort desc,read_num desc');
  21. }
  22. public function itemList2(){
  23. return $this->hasMany('ArticleItem','article_id')
  24. ->where('is_deleted',0)
  25. ->where('status',1)
  26. ->where('release_time','< time',date("Y-m-d H:i:s"))
  27. ->field('id,article_id,release_time,user_id,cover,is_vip,sort,transmit_num,read_num,title,images,content_type,pdf,video_id,video_item,datum_id,datum_item,author,desc,desc_text,goods_id,comment_switch,pdf_clear');
  28. // ->order('sort desc,read_num desc');
  29. }
  30. public function itemChildren()
  31. {
  32. return $this->hasMany('ArticleItem','article_id')
  33. ->where('is_deleted',0)
  34. ->field('id,article_id,title,video_id')
  35. ->order('sort desc');
  36. }
  37. }