本文整理匯總了PHP中CommonUtil::GetDefRes方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonUtil::GetDefRes方法的具體用法?PHP CommonUtil::GetDefRes怎麽用?PHP CommonUtil::GetDefRes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonUtil
的用法示例。
在下文中一共展示了CommonUtil::GetDefRes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addImagesRecord
/**
* 圖譜科技的相關數據插入到數據庫中
* 色情+人物類型:
*/
public static function addImagesRecord($data, $item)
{
$ok = 0;
// 內容為空
$date_empty = 1;
// 內容為空
$log = new FLogger("images_log");
$data = json_decode($data, true);
if ($data && $data["code"] == 0) {
// 檢測成功
$images = array();
if ($item == Service_TupuTech::$SEXY_AND_AD) {
//“通用廣告”的返回值,“5588dba4c7ee53a04b5fad7d”是“通用廣告”的識別任務的TaskID
$ad_data = $data["5588dba4c7ee53a04b5fad7d"];
if ($ad_data) {
$file_list = $ad_data["fileList"];
foreach ($file_list as $file) {
$name = CommonUtil::getOriginImg($file["name"]);
$arr = array();
if (array_key_exists($name, $images)) {
$arr = $images[$name];
}
$arr["ad_rate"] = 100 * $file["rate"];
$arr["ad_flag"] = $file["label"];
$review = 1;
if (!$file["review"]) {
$review = 0;
}
$arr["ad_review"] = $review;
$arr["human_review"] = 0;
$images[$name] = $arr;
}
}
}
if ($item == Service_TupuTech::$SEXY_AND_HUMAN) {
//“任務識別”的返回值,“dbd1d2c23705e7102070e6”是“色情+人物”的識別任務的TaskID
$ad_data = $data["554202c4b01bd8ee3b6c005c"];
if ($ad_data) {
$file_list = $ad_data["fileList"];
foreach ($file_list as $file) {
$name = CommonUtil::getOriginImg($file["name"]);
$arr = array();
if (array_key_exists($name, $images)) {
$arr = $images[$name];
}
$arr["human_rate"] = 100 * $file["rate"];
$arr["human_flag"] = $file["label"];
$review = 1;
if (!$file["review"]) {
$review = 0;
}
$arr["human_review"] = $review;
$arr["ad_review"] = 0;
$images[$name] = $arr;
}
}
}
// “是否色情”的返回值,“54bcfc6c329af61034f7c2fc”是“是否色情”的識別任務的TaskID
$sexy_data = $data["54bcfc6c329af61034f7c2fc"];
if ($sexy_data) {
$file_list = $sexy_data["fileList"];
foreach ($file_list as $file) {
$name = CommonUtil::getOriginImg($file["name"]);
$arr = array();
if (array_key_exists($name, $images)) {
$arr = $images[$name];
}
$arr["sexy_rate"] = 100 * $file["rate"];
$arr["sexy_flag"] = $file["label"];
$review = 1;
if (!$file["review"]) {
$review = 0;
}
$arr["sexy_review"] = $review;
$arr["item"] = $item;
$images[$name] = $arr;
}
}
$db_data = self::doCheck($images, $item);
self::addIntoDb($db_data);
$res_data = array();
foreach ($db_data as $img) {
$item = array();
$item["url"] = $img["url"];
$item["status"] = $img["status"];
array_push($res_data, $item);
}
$log->append("tuputech is ok " . json_encode($db_data));
return CommonUtil::GetDefRes($ok, "success", $res_data);
} else {
$log->append("[ERROR] tuputech is error " . json_encode($data));
return CommonUtil::GetDefRes($date_empty, " data is empty or code is not 0");
}
}
示例2: verifyUserSecondAction
/**
* 用戶資料複審
*/
function verifyUserSecondAction()
{
$id = FRequest::getInt("id");
$uid = FRequest::getInt("uid");
$status = FRequest::getInt("status");
// $reason = FRequest::getString("reason");
if (CommonUtil::parmIsEmpty($uid) || CommonUtil::parmIsEmpty($status) || CommonUtil::parmIsEmpty($id)) {
FResponse::output(CommonUtil::GetDefRes(201, "參數錯誤"));
return;
}
//請求服務端接口
$url = FConfig::get('global.service_mumu_url') . "/s/user/IUserInfoVerify";
$res = Service_Common::secPost($url, array("id" => $id, "uid" => $uid, "level" => $status));
FResponse::output($res);
}
示例3: updateAction
public function updateAction()
{
$c_uid = trim(FRequest::getString("c_uid"));
$ver = FRequest::getInt("ver");
$status = FRequest::getInt("status");
$c_sid = trim(FRequest::getString("c_sid"));
$data = array('status' => $status);
$where = array('ver' => $ver, 'c_uid' => $c_uid, 'c_sid' => $c_sid);
$t = new FTable("app_version");
$t->update($data, $where);
FResponse::output(CommonUtil::GetDefRes(200, "操作成功"));
return;
}
示例4: secPost
/**
* 安全post請求,會追加當前登錄用戶cookie
*/
public static function secPost($url, $params)
{
$cookie = "sid=" . FSession::get('sid') . ";uid=" . FSession::get('user_id') . ";key=" . FSession::get('sid');
$res = FHttp::doPost($url, $params, $cookie);
$params = json_decode($res);
if ($params->status == "ok") {
$res = CommonUtil::GetDefRes(200, "正確");
} else {
$res = CommonUtil::GetDefRes(201, "錯誤");
}
echo "----" . $res;
return $res;
}