<?php
/**
 * 视频标签添加
 * $Id: ajax_add_media_tag.php
 * @author lixq
 * @access public
 * @package manager.public_html
 */

// クラス・設定読み込み
require_once ("manager_include.inc");

// ログインチェック
require_once ("check_login.inc");


$tag = ParamUtil::getRequestString("tag");
// 参数检查
if (empty($tag)) {
  CompassHandler::responseApiNg("0001", "请输入标签名!");
}

$param = [];
$param["delete_flg"] = false;
$param["tag"] = $tag;
$tag_count = MediaTagDat::getListCount($param);
if($tag_count > 0){
  CompassHandler::responseApiNg("0002", "已存在此标签名!");
}

$media_tag_dat = new MediaTagDat();
$media_tag_dat->tag = $tag;
$media_tag_dat->save();

CompassHandler::responseApiOk("");