當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserInfo::userinfo_select方法代碼示例

本文整理匯總了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;
 }
開發者ID:bmchun,項目名稱:sunset,代碼行數:18,代碼來源:UserProfile.php

示例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;
             }
         }
     }
 }
開發者ID:bmchun,項目名稱:sunset,代碼行數:41,代碼來源:upAddress.php

示例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);
開發者ID:bmchun,項目名稱:sunset,代碼行數:31,代碼來源:setuserinfo.php


注:本文中的UserInfo::userinfo_select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。