|
@@ -114,6 +114,9 @@ class NewsService implements NewsServiceInterface
|
|
*/
|
|
*/
|
|
public function addCategory(array $data): array
|
|
public function addCategory(array $data): array
|
|
{
|
|
{
|
|
|
|
+ if(isset($data['id'])){
|
|
|
|
+ unset($data['id']);
|
|
|
|
+ }
|
|
$id = Category::insertGetId($data);
|
|
$id = Category::insertGetId($data);
|
|
if (empty($id)) {
|
|
if (empty($id)) {
|
|
return Result::error("添加失败");
|
|
return Result::error("添加失败");
|