本文整理汇总了PHP中UserDAO::giveAchievement方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDAO::giveAchievement方法的具体用法?PHP UserDAO::giveAchievement怎么用?PHP UserDAO::giveAchievement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserDAO
的用法示例。
在下文中一共展示了UserDAO::giveAchievement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AspidAuth
require_once "../classes/UserDAO.php";
require_once "../classes/AspidAuth.php";
if ($_POST != null) {
$auth = new AspidAuth();
$member = $auth->authOpenAPIMember();
if (!$member || !$auth->checkRole("GIVE_AWARD")) {
do_return(null, "Нет доступа!");
}
$dao = new UserDAO();
if (isset($_POST['jsn'])) {
$array = json_decode($_POST['jsn']);
$uids = json_decode($array->jsn);
$name = $array->name;
$descr = $array->descr;
foreach ($uids as $uid) {
$dao->giveAchievement($name, $descr, $uid->uid, $member['uid']);
}
do_return("SUCCESS", null);
}
/*
*
* create table aspid_achievements
(
id integer primary key default nextval('aspid_achievements_seq'),
name varchar(400),
description varchar (4000),
uid integer references aspid_users,
from_who integer references aspid_users,
date_give date default current_date,
type integer references aspid_achievement_type
);