<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### **文件** 因函數比較多在這不全部列舉只列舉比較常用的函數 Common函數位于/Application/Common/Common/function.php中不懂的可以進去參考 **is_login()** 說明: 檢測用戶是否已登陸 返回值: integer 0-未登錄,大于0-當前登錄用戶ID **is_administrator($uid = null)** 說明:檢測用戶是否是超級管理員 返回值 boolean true-管理員,false-非管理員 **str2arr($str, $glue = ',')** 說明:字符串轉換為數組,與explode功能相同,只是參數順序不同 參數 string $str 要分割的字符串 參數 string $glue 分割符 返回值 array **arr2str($arr, $glue = ',')** 說明:數組轉換為字符串,與implode功能相同,只是參數順序不同 參數 array $arr 要連接的數組 參數 string $glue 分割符 返回值 strink **think_encrypt($data, $key = '', $expire = 0)** 說明:數據加密方法,將需要加密的數據串加密為字符串。 參數 string $data 要加密的字符串 參數 string $key 加密密鑰 參數 int $expire 過期時間 單位 秒 返回值 string **think_decrypt($data, $key = '')** 說明:數據解密方法,將think_encrypt加密過的數據還原。 **list_sort_by($list,$field, $sortby='asc')** 說明: 對查詢結果集進行排序 參數 array $list 查詢結果 參數 string $field 排序的字段名(單個) 參數 array $sortby 排序類型 asc正向排序 desc逆向排序 nat自然排序 返回值 array **data_auth_sign($data)** 說明:數據簽名認證,用于驗證提供的數據與存儲的數據是否一致。 參數 array $data 被認證的數據 返回值 string 簽名 **list_to_tree($list, $pk='id', $pid = 'pid', $child = '_child', $root = 0)** 說明:把返回的查詢數據集轉換成多維數組的樹狀結構數據 參數 array $list 要轉換的數據集 參數 string $pk 數據集的主鍵 參數 string $pid 父id數據字段 參數 string $child 用來保存子數據的鍵名 參數 int $root 根元素的父id 返回值 array **tree_to_list($tree, $child = '_child', $order='id', &$list = array())** 說明: 將list_to_tree生成的多維數組樹狀結構數據還原成普通的查詢列表 參數 array $tree list_to_tree生成的多維數組樹狀結構數據 參數 string $child 保存子數據的鍵名 參數 string $order 排序顯示的鍵,一般是主鍵 升序排列 參數 array $list 過渡用的中間數組 返回值 array 返回排過序的列表數組 **format_bytes($size, $delimiter = '')** 說明:字節格式化 參數 number $size 字節數 參數 string $delimiter 數字和單位分隔符 返回值 string 格式化后的帶單位的大小,例如:2KB **get_addon_class($name)** 說明:根據插件簡單類名返回插件類的命名空間類名 參數 strng $name 插件名 返回值 string **get_addon_config($name)** 說明:獲取插件類的配置數組 參數 string $name 插件名 **addons_url($url, $param = array())** 說明:生成用于訪問插件控制器的url 參數 string $url url 例如:'Attachment://Attachment/download' 參數 array $param 參數,例如'id=2' 返回值 string **time_format($time = NULL,$format='Y-m-d H:i')** 說明:時間戳格式化,與date函數功能相同,只是參數順序不同 參數 int $time **get_username($uid = 0)** 說明:根據用戶ID獲取用戶名。首先會嘗試從session獲取,其次嘗試從緩存獲取,如果沒有獲取到,從數據庫獲取并緩存。 參數 integer $uid 用戶ID 返回值 string 用戶名 **get_nickname($uid = 0)** 說明:根據用戶ID獲取用戶昵稱。首先會嘗試從session獲取,其次嘗試從緩存獲取,如果沒有獲取到,從數據庫獲取并緩存。 根據用戶ID獲取用戶昵稱 參數 integer $uid 用戶ID 返回值 string 用戶昵稱 **get_category($id, $field = null)** 說明:獲取某個分類的某個字段的值并緩存 參數 integer $id 分類ID 參數 string $field 要獲取的字段名 返回值 string 字段的值 **get_category_name($id)** 說明:根據ID獲取分類標識 **get_category_title($id)** 說明:根據ID獲取分類名稱 **get_document_model($model_id = null, $field = null)** 說明:根據模型id獲取文檔模型的某個字段的值并緩存 參數 integer $model_id 模型ID 參數 string $field 模型字段 返回值 array **action_log($action = null, $model = null, $record_id = null, $user_id = null)** 說明:執行該行為的規則,并記錄行為日志 參數 string $action 行為標識 參數 string $model 觸發行為的模型名,例如:'document' 參數 int $record_id 觸發行為的記錄id 參數 int $user_id 執行行為的用戶id 返回值 boolean **parse_action($action = null, $self)** 說明: 將一條行為定義文本解析為行為規則數組。 規則定義 table:$table|field:$field|condition:$condition|rule:$rule[|cycle:$cycle|max:$max][;......] 規則字段解釋:table->要操作的數據表,不需要加表前綴; field->要操作的字段; condition->操作的條件,目前支持字符串,默認變量{$self}為執行行為的用戶 rule->對字段進行的具體操作,目前支持四則混合運算,如:1+score*2/2-3 cycle->執行周期,單位(小時),表示$cycle小時內最多執行$max次 max->單個周期內的最大執行次數($cycle和$max必須同時定義,否則無效) 單個行為后可加 ; 連接其他規則 參數 string $action 行為id或者name 參數 int $self 替換規則里的變量為執行用戶的id 返回值 boolean|array: false解析出錯 , 成功返回規則數組 **execute_action($rules = false, $action_id = null, $user_id = null)** 說明:執行行為 參數 array $rules parse_action解析后的行為規則數組 參數 int $action_id 行為id 參數 array $user_id 執行的用戶id 返回值 boolean false 失敗 , true 成功 **create_dir_or_files($files)** 說明:基于數組創建目錄和文件,每個目錄或文件作為數組的一個元素 **array_column(array $input, $columnKey, $indexKey = null)** 說明:PHP5.5的自帶函數兼容實現,來自PHP手冊 **get_table_name($model_id = null)** 說明:獲取表名(不含表前綴) 參數 string $model_id 返回值 string 表名 **get_model_attribute($model_id, $group = true)** 說明:獲取模型屬性信息并緩存 參數 integer $id 屬性ID 參數 string $field 要獲取的字段名 返回值 string 屬性信息 **api($name,$vars=array())** 說明:調用系統的API接口的靜態方法,例如:api('User/getName','id=5');// 調用公共模塊的User接口的getName方法 參數 string $name 格式 [模塊名]/接口名/靜態方法名 參數 array|string $vars 參數 **get_link($link_id = null, $field = 'url')** 說明: 根據外鏈id(onethink_url表),返回外鏈的其他字段值,默認返回url字段值 參數 int $link_id 主鍵值 參數 string $field 字段值 **get_cover($cover_id, $field = null)** 說明:根據圖片id(onethink_picture)返回圖片的其他字段值,默認返回所有整行記錄 參數 int $cover_id 主鍵值 參數 string $field 字段名 返回值: 完整的數據 或者 指定的$field字段值 **check_document_position($pos = 0, $contain = 0)** 說明: 文檔推薦位檢測.檢測文檔推薦位是否含有含有某個推薦位設置.例如,文檔推薦位的值為5,則 check_document_position(5, 1)和`check_document_position(5, 4)`都返回true,而check_document_position(5, 8)返回false.實際上,該函數做的是位檢測,所以也可以用于檢測其通過位相加保存數據的情況. 參數 number $pos 推薦位的值(數據庫保存的字段值) 參數 number $contain 推薦位值(推薦位定義) 返回 true 包含 , false 不包含
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看