12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace app\common\model;
- use think\Model;
- // 图文
- class ArticleIntro extends Model
- {
- public function itemList(){
- return $this->hasMany('ArticleItem','article_id')
- ->where('is_deleted',0)
- ->where('status',1)
- ->where('release_time','< time',date("Y-m-d H:i:s"))
- ->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');
- // ->order('sort desc,read_num desc');
- }
- public function itemList3(){
- return $this->hasMany('ArticleItem','article_id')
- ->where('is_deleted',0)
- ->where('release_time','< time',date("Y-m-d H:i:s"))
- ->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');
- // ->order('sort desc,read_num desc');
- }
- public function itemList2(){
- return $this->hasMany('ArticleItem','article_id')
- ->where('is_deleted',0)
- ->where('status',1)
- ->where('release_time','< time',date("Y-m-d H:i:s"))
- ->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');
- // ->order('sort desc,read_num desc');
- }
- public function itemChildren()
- {
- return $this->hasMany('ArticleItem','article_id')
- ->where('is_deleted',0)
- ->field('id,article_id,title,video_id')
- ->order('sort desc');
- }
- }
|