mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 18:42:49 +08:00
完善文章管理
This commit is contained in:
@@ -189,5 +189,15 @@ class Post extends Common
|
||||
public function delete($id)
|
||||
{
|
||||
//
|
||||
|
||||
$model_post = ModelPost::find($id);
|
||||
|
||||
$model_post->delete();
|
||||
|
||||
PostCategory::where('post_id',$id)->delete();
|
||||
|
||||
PostTag::where('post_id',$id)->delete();
|
||||
|
||||
return json_message();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,57 @@ class ColumnFormat
|
||||
public static function timestamp($name){
|
||||
return Column::make($name,'integer')
|
||||
->setLimit(10)
|
||||
->setSigned(false);
|
||||
->setSigned(false)
|
||||
->setDefault(0);
|
||||
}
|
||||
public static function loadDeleteTime(){
|
||||
return Column::make('delete_time','integer')
|
||||
|
||||
public static function stringLong($name)
|
||||
{
|
||||
return Column::make($name,'string')
|
||||
->setLimit(500)
|
||||
->setDefault('');
|
||||
}
|
||||
public static function stringNormal($name)
|
||||
{
|
||||
return Column::make($name,'string')
|
||||
->setLimit(100)
|
||||
->setDefault('');
|
||||
}
|
||||
|
||||
public static function stringUrl($name)
|
||||
{
|
||||
return Column::make($name,'string')
|
||||
->setLimit(300)
|
||||
->setDefault('');
|
||||
}
|
||||
|
||||
public static function stringMd5($name)
|
||||
{
|
||||
return Column::make($name,'string')
|
||||
->setLimit(32)
|
||||
->setDefault('');
|
||||
}
|
||||
|
||||
public static function stringShort($name)
|
||||
{
|
||||
return Column::make($name,'string')
|
||||
->setLimit(20)
|
||||
->setDefault('');
|
||||
}
|
||||
|
||||
public static function integerTypeStatus($name)
|
||||
{
|
||||
return Column::make($name,'integer')
|
||||
->setLimit(10)
|
||||
->setSigned(false)
|
||||
->setDefault(0);
|
||||
}
|
||||
|
||||
public static function integer($name)
|
||||
{
|
||||
return Column::make($name,'integer')
|
||||
->setDefault(0)
|
||||
->setLimit(20)
|
||||
->setSigned(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user