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


PHP city::select方法代碼示例

本文整理匯總了PHP中city::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP city::select方法的具體用法?PHP city::select怎麽用?PHP city::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在city的用法示例。


在下文中一共展示了city::select方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

<?php

$city = city::select()->where("`name` = '?'", $parts[1])->one();
if ($city === false) {
    return 404;
}
$smarty->contentType('text', 'json');
$venues = venue::select()->where(isset($parts[2]) ? array($city, 'type' => $parts[2]) : $city)->order_by('title')->many();
echo '{"license": "Copyright, All Rights Reserved, Usage of this data without explicit permission is strictly forbidden!", "name": "' . $city->name . '", "title": "' . $city->title . '", "data": [';
foreach ($venues as $key => $venue) {
    if ($key > 0) {
        echo ",";
    }
    $data = $venue->get_row();
    $hours = hours::select()->where($venue)->many();
    unset($data['id']);
    unset($data['city_id']);
    $data['hours'] = array(null, null, null, null, null, null, null);
    foreach ($hours as $hour) {
        foreach (explode(',', $hour->weekday) as $day) {
            switch ($day) {
                case 'mon':
                    $data['hours'][0] = array($hour->open, $hour->close);
                    break;
                case 'tue':
                    $data['hours'][1] = array($hour->open, $hour->close);
                    break;
                case 'wed':
                    $data['hours'][2] = array($hour->open, $hour->close);
                    break;
                case 'thu':
開發者ID:vkpriyesh,項目名稱:isitopen,代碼行數:31,代碼來源:data.php


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