__('Hidedata 0'), '1' => __('Hidedata 1')]; } public function getIsHotdataList() { return ['0' => __('Is_hotdata 0'), '1' => __('Is_hotdata 1')]; } public function getIsRecdataList() { return ['0' => __('Is_recdata 0'), '1' => __('Is_recdata 1')]; } public function getStatusList() { return ['0' => __('Status 0'), '1' => __('Status 1')]; } public function getHidedataTextAttr($value, $data) { $value = $value ? $value : (isset($data['hidedata']) ? $data['hidedata'] : ''); $list = $this->getHidedataList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsHotdataTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_hotdata']) ? $data['is_hotdata'] : ''); $list = $this->getIsHotdataList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsRecdataTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_recdata']) ? $data['is_recdata'] : ''); $list = $this->getIsRecdataList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public static function lst($where) { $model = new self; $model =$model->where('hidedata',0)->where('status',1); if(iset($where['cid']) && $where['cid']>0) $model->where('cid',$where['cid']); if(iset($where['is_hot']) && $where['is_hot']==1) $model->where('is_hotdata',$where['is_hot']); if(iset($where['is_rec']) && $where['is_rec']==1) $model->where('is_recdata',$where['is_rec']); if(iset($where['ifyid']) && $where['ifyid']>0) { $ids = get_all_categories(ArticleCategory::lst(['cid'=>$where['cid']])); $model = $model->wherein('article_category_id',$ids); } if(iset($where['key']) && $where['key']!='') $model->whereLike('title',"%{$where['key']}%"); return $model->order('sort desc,releasetime desc')->page($where['page'],$where['limit'])->select()->toArray(); } }