本文整理匯總了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':