Commit d69560b6 by 杨昕

sfd

parent a115fbe6
......@@ -48,19 +48,16 @@ class MediaCategoryModel extends Eloquent
'status' => 0
];
$mediaCatg = DB::connection("mongodb")->collection(self::$collection)->where('name',$request->name)->first();
$mediaCatg = MediaCategoryModel::where('name',$request->name)->first();
if (!empty($mediaCatg)){
throw new \Exception('媒资类别已经存在');
}
$id = DB::connection("mongodb")->collection(self::$collection)->insertGetId($data);
$id = MediaCategoryModel::insertGetId($data);
}catch (\Exception $exception){
throw new DatabaseException("组织不存在");
}
return $id;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment