__('Status 0'), '1' => __('Status 1')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } /** * 获取轮播 * @param $cid * @return bool|\PDOStatement|string|\think\Collection * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public static function getbanner($cid,$limit=5) { return self::where('cid',$cid)->where('category_id',27)->where('status',1)->limit($limit)->order('sort desc,id asc')->select()->toArray(); } }