本文整理汇总了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':