<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之旅 廣告
                ```php <?php /** * Author: Virus * Date: 2020/3/5 * Time: 17:41 */ namespace app\common\lib; class Arr { /** * @desc 無限極分類 * @param $data * @return array */ public static function getTree($data) { $items = []; foreach ($data as $v) { $items[$v['category_id']] = $v; } $tree = []; foreach ($items as $id => $item) { if (isset($items[$item['pid']])) { $items[$item['pid']]['list'][] = &$items[$id]; } else { $tree[] = &$items[$id]; } } return $tree; } /** * @desc 一級分類顯示5個,二級分類顯示3個,三級分類顯示5個 * @param $data * @param int $firstCount * @param int $secondCount * @param int $thirdCount * @return array */ public static function sliceTreeArr($data, $firstCount = 5, $secondCount = 3, $thirdCount = 5) { $data = array_slice($data, 0, $firstCount); foreach ($data as $k => $v) { if (!empty($v['list'])) { $data[$k]['list'] = array_slice($v['list'], 0, $secondCount); foreach ($v['list'] as $kk => $vv) { if (!empty($vv['list'])) { $data[$k]['list'][$kk]['list'] = array_slice($vv['list'], 0, $thirdCount); } } } } return $data; } /** * 分頁默認返回的數據 * @param $num * @return array */ public static function getPaginateDefaultData($num) { $result = [ "total" => 0, "per_page" => $num, "current_page" => 1, "last_page" => 0, "data" => [], ]; return $result; } /** * 數組排序 * @param $result * @param $key * @param int $sort * @return array|bool */ public static function arrsSortByKey($result, $key, $sort = SORT_DESC) { if (!is_array($result) || !$key) { return []; } array_multisort(array_column($result, $key), $sort, $result); return $result; } } ```
                  <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>

                              哎呀哎呀视频在线观看