mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 02:22:48 +08:00
文章可设置类型用于不同而类型
This commit is contained in:
@@ -19,7 +19,7 @@ class Category extends Common
|
||||
{
|
||||
//
|
||||
|
||||
$list = ModelCategory::getListLevel();
|
||||
$list = ModelCategory::getListLevel('',$this->request->param('type',1));
|
||||
|
||||
if($this->request->isAjax()){
|
||||
return json_message($list);
|
||||
@@ -39,7 +39,7 @@ class Category extends Common
|
||||
{
|
||||
//
|
||||
|
||||
$list = ModelCategory::getListLevel();
|
||||
$list = ModelCategory::getListLevel('',$this->request->param('type',1));
|
||||
|
||||
View::assign('list_category',$list);
|
||||
|
||||
@@ -107,7 +107,7 @@ class Category extends Common
|
||||
|
||||
$model_category = ModelCategory::find($id);
|
||||
|
||||
$list = ModelCategory::getListLevel();
|
||||
$list = ModelCategory::getListLevel('',$this->request->param('type',1));
|
||||
|
||||
View::assign('list_category',$list);
|
||||
View::assign('category',$model_category);
|
||||
|
||||
@@ -23,7 +23,10 @@ class Post extends Common
|
||||
{
|
||||
//
|
||||
|
||||
$list = ModelPost::with(['categorys.category','tags.tag'])->order('id desc')->paginate();
|
||||
$list = ModelPost::with(['categorys.category','tags.tag'])
|
||||
->where('type',$this->request->param('type',1))
|
||||
->order('id desc')
|
||||
->paginate();
|
||||
|
||||
View::assign('list', $list);
|
||||
|
||||
|
||||
@@ -19,7 +19,9 @@ class Tag extends Common
|
||||
{
|
||||
//
|
||||
|
||||
$list_tag = ModelTag::order('id desc')->paginate();
|
||||
$list_tag = ModelTag::order('id desc')
|
||||
->where('type',$this->request->param('type',1))
|
||||
->paginate();
|
||||
|
||||
if($this->request->isAjax()){
|
||||
return json_message($list_tag);
|
||||
|
||||
@@ -46,12 +46,12 @@ class ColumnFormat
|
||||
->setDefault('');
|
||||
}
|
||||
|
||||
public static function integerTypeStatus($name)
|
||||
public static function integerTypeStatus($name,$default = 0)
|
||||
{
|
||||
return Column::make($name,'integer')
|
||||
->setLimit(10)
|
||||
->setSigned(false)
|
||||
->setDefault(0);
|
||||
->setDefault($default);
|
||||
}
|
||||
|
||||
public static function integer($name)
|
||||
|
||||
@@ -23,7 +23,7 @@ class Category extends Model
|
||||
* @param string $id
|
||||
* @return void
|
||||
*/
|
||||
public static function getListLevel($id = '')
|
||||
public static function getListLevel($id = '',$type = 1)
|
||||
{
|
||||
|
||||
if(empty(self::$allCategory)){
|
||||
|
||||
Reference in New Issue
Block a user