本文整理汇总了PHP中UserInfo::userinfo_select方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInfo::userinfo_select方法的具体用法?PHP UserInfo::userinfo_select怎么用?PHP UserInfo::userinfo_select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::userinfo_select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userinfo_3
function userinfo_3($usid, $tel = null)
{
$arr = isset($tel) ? array("tel" => $tel) : array("usid" => $usid);
$limit = 1;
$re = UserInfo::userinfo_select($arr, $limit);
$selfinfo = mysql_fetch_array($re, MYSQL_ASSOC);
$a = array('nickname', 'image', 'gender', 'provice');
$count = 0;
foreach ($selfinfo as $key => $value) {
if (in_array($key, $a)) {
if (isset($value)) {
$count++;
}
}
}
$selfinfo['percent'] = floor($count / 4 * 100);
return $selfinfo;
}
示例2: upAddress
function upAddress($data = array(), $uid, $isParent = 0, $isMum = 1)
{
//$condition = '`childID`='.$uid;
$se_uid = array('uid' => $uid);
$arr = array('childID' => $uid, 'isMum' => $isMum);
//$p = ($isMum = 1 ? "母":"父");
if (!$isParent) {
if (mysql_fetch_array(UserInfo::userinfo_select($se_uid, 1))) {
$condition = '`uid`=' . $uid;
$re = UserInfo::userinfo_update($data, $condition);
if ($re) {
return mysql_fetch_array(UserInfo::userinfo_select($se_uid, 1), MYSQL_ASSOC);
} else {
return 400;
}
} else {
return 400;
}
} else {
if (ParentInfo::parentinfo_select_affect($arr, 1)) {
$data['childID'] = $uid;
$data['isMum'] = $isMum;
$condition = '`childID`=' . $uid . ' AND `isMum`=' . $isMum;
$re = ParentInfo::parentinfo_update($data, $condition);
if ($re) {
return mysql_fetch_array(ParentInfo::parentinfo_select($arr, 1), MYSQL_ASSOC);
} else {
return 400;
}
} else {
$data['childID'] = $uid;
$data['isMum'] = $isMum;
$re = ParentInfo::parentinfo_insert($data);
if ($re) {
return mysql_fetch_array(ParentInfo::parentinfo_select($arr, 1), MYSQL_ASSOC);
} else {
return 400;
}
}
}
}
示例3: fopen
$fp = fopen('./log', 'a+');
if ($debug) {
fwrite($fp, json_encode($_POST) . "\n");
fclose($fp);
}
//增加用户个人信息
$res = new Response();
if (isset($_POST['data'])) {
$arr = $_POST['data'];
$arr_select = array('uid' => $arr['uid']);
//$arr['uid'] = md5($arr['tel']);
$arr['password'] = md5($arr['password']);
$arr['registerDate'] = date("Y/m/d");
$condition = isset($arr['tel']) ? 'tel=\'' . $arr['tel'] . '\'' : 'uid=\'' . $arr['uid'] . '\'';
$setUser = new UserInfo();
$re_select = $setUser->userinfo_select($arr_select, 1);
//uid如果已经存在的用户,更新资料
if (mysql_fetch_row($re_select)) {
$arr['gender'] = isset($arr['gender']) ? $arr['gender'] : 0;
$arr['age'] = isset($arr['age']) ? $arr['age'] : 0;
$arr['idCard'] = isset($arr['idCard']) ? $arr['idCard'] : '';
$arr['realName'] = isset($arr['realName']) ? $arr['realName'] : '';
$arr['birthDate'] = isset($arr['birthDate']) ? $arr['birthDate'] : '';
$checkArr = array('uid' => $arr['uid']);
//更新个人信息
$r = $setUser->userinfo_select($checkArr, 1);
if (!mysql_fetch_assoc($r)) {
echo $res->show(407);
exit;
}
$re = $setUser->userinfo_update($arr, $condition);