@@ -38,12 +38,11 @@ class MenuApi extends MenuApiModel
/**
* 根据菜单id批量删除记录
* @param int $menuId
- * @return bool
- * @throws \Exception
+ * @return void
*/
- private function removeByMenuId(int $menuId)
+ private function removeByMenuId(int $menuId): void
{
- return $this->where('menu_id', '=', $menuId)->delete();
+ static::deleteAll(['menu_id' => $menuId]);
}
@@ -213,7 +213,7 @@ abstract class BaseModel extends Model
* ['store_user_id', '=', $storeUserId],
* ['role_id', 'in', $deleteRoleIds]
* ]
- * @return bool|int
+ * @return bool|int 这里实际返回的是数量int
public static function deleteAll(array $where)