本文整理汇总了PHP中Widgets::offers方法的典型用法代码示例。如果您正苦于以下问题:PHP Widgets::offers方法的具体用法?PHP Widgets::offers怎么用?PHP Widgets::offers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widgets
的用法示例。
在下文中一共展示了Widgets::offers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<span class="votes_counter"><?php
echo $ratings['votes'];
?>
<?php
echo Yii::t("default", "Votes");
?>
</span>
</div>
</div>
</div> <!--uk-grid-->
<?php
Widgets::shareWidget($re_info['restaurant_name']);
?>
<?php
echo Widgets::offers($merchant_id);
?>
</div> <!--END uk-width-1-2-->
</div>
</div> <!--restaurant-wrap-->
<div class="rating-wrapper">
<div class="uk-grid">
<div class="uk-width-1-2" style="width:220px;padding-top:10px;">
<a href="javascript:;" class="write-review btn-flat-grey rounded2 <?php
echo $has_reviews == true ? "active" : "";
?>
">
<?php
示例2: searchArea
//.........这里部分代码省略.........
$stores_open_ends = !empty($stores_open_ends) ? (array) json_decode($stores_open_ends) : false;
$stores_open_custom_text = !empty($stores_open_custom_text) ? (array) json_decode($stores_open_custom_text) : false;
$tip = '';
$open_starts = '';
$open_ends = '';
$open_text = '';
$tip .= "<ul class=\"hr_op rounded2\"><i class=\"fa fa-caret-up\"></i>";
if (is_array($stores_open_day) && count($stores_open_day) >= 1) {
foreach ($stores_open_day as $val_open) {
if (array_key_exists($val_open, (array) $stores_open_starts)) {
$open_starts = timeFormat($stores_open_starts[$val_open], true);
}
if (array_key_exists($val_open, (array) $stores_open_ends)) {
$open_ends = timeFormat($stores_open_ends[$val_open], true);
}
if (array_key_exists($val_open, (array) $stores_open_custom_text)) {
$open_text = $stores_open_custom_text[$val_open];
}
$tip .= '<li><span>' . ucwords(Yii::t("default", $val_open)) . '</span><value>' . $open_starts . " - " . $open_ends . " " . ucfirst($open_text) . '</value></li>';
$open_starts = '';
$open_ends = '';
$open_text = '';
}
} else {
$tip .= '<li>' . Yii::t("default", "Not available.") . '</li>';
}
$tip .= "<div class=\"clear\"></div>";
$tip .= "</ul>";
$tips = "<a class=\"opening-hours-wrap\" href=\"javascript:;\">" . Yii::t("default", "Hours of Operation") . "{$tip}</a>";
$resto_info .= $tips;
$resto_info .= "<div class=\"spacer\"></div>";
$resto_info .= "<div>\r\n\t\t\t\t\t\t<a class=\"uk-button uk-button-success uk-width-1-2\" href=\"" . baseUrl() . "/store/menu/merchant/" . $val['restaurant_slug'] . "\">";
$resto_info .= Yii::t("default", "Order Now");
$resto_info .= "</a></div>";
$resto_info .= "<div class=\"spacer\"></div>";
$table_book = Yii::app()->functions->getOption("merchant_table_booking", $val['merchant_id']);
if ($table_book == "") {
$resto_info .= "<div>\r\n\t\t\t\t\t\t<a class=\"uk-button uk-button-success uk-width-1-2\" href=\"" . baseUrl() . "/store/menu/merchant/" . $val['restaurant_slug'] . "/?tab=booking" . "\">";
$resto_info .= Yii::t("default", "Book a Table");
$resto_info .= "</a></div>";
}
$is_sponsored = '';
if ($val['is_sponsored'] == 2) {
$is_sponsored = "<br/><div class=\"uk-badge uk-badge-warning\">" . Yii::t("default", "sponsored") . "</div>";
}
$is_merchant_open = Yii::app()->functions->isMerchantOpen($val['merchant_id']);
$merchant_preorder = Yii::app()->functions->getOption("merchant_preorder", $val['merchant_id']);
$now = date('Y-m-d');
$is_holiday = false;
if ($m_holiday = Yii::app()->functions->getMerchantHoliday($val['merchant_id'])) {
if (in_array($now, (array) $m_holiday)) {
$is_merchant_open = false;
}
}
$tag_open = '';
if ($is_merchant_open == TRUE) {
$tag_open = '<div class="uk-badge uk-badge-success">' . t("Open") . '</div>';
} else {
if ($merchant_preorder) {
$tag_open = '<div class="uk-badge uk-badge-warning">' . t("Pre-Order") . '</div>';
} else {
$tag_open = '<div class="uk-badge uk-badge-danger">' . t("Closed") . '</div>';
}
}
$is_sponsored .= $tag_open;
$offers = Widgets::offers($val['merchant_id'], 2);
$is_sponsored .= $offers;
$merchant_latitude = Yii::app()->functions->getOption("merchant_latitude", $val['merchant_id']);
$merchant_longtitude = Yii::app()->functions->getOption("merchant_longtitude", $val['merchant_id']);
$merchant_latitude = !empty($merchant_latitude) ? $merchant_latitude : '0';
$merchant_longtitude = !empty($merchant_longtitude) ? $merchant_longtitude : '0';
$feed_data[] = array($image, $resto_info, $rating, !empty($val['minimum_order']) ? displayPrice(getCurrencyCode(), prettyFormat($val['minimum_order'])) . "<br/>" . $is_sponsored : "{$is_sponsored}", $miles_raw, $merchant_latitude, $merchant_longtitude, addslashes($val['restaurant_name']), $merchant_address, $val['restaurant_slug'], $image, $new_distance_raw);
}
$this->data['sort_filter'] = isset($this->data['sort_filter']) ? $this->data['sort_filter'] : '';
//dump($feed_data);
if ($this->data['sort_filter'] == "distance") {
Yii::app()->functions->arraySortByColumn($feed_data, 11);
$feed_datas['aaData'] = $feed_data;
} else {
/** sort by distance */
if (Yii::app()->functions->getOptionAdmin('search_result_bydistance') == 2) {
Yii::app()->functions->arraySortByColumn($feed_data, 11);
$feed_datas['aaData'] = $feed_data;
} else {
$feed_datas['aaData'] = $feed_data;
}
}
//dump("minus_has_delivery_rates->".$minus_has_delivery_rates);
if ($minus_has_delivery_rates >= 1) {
$feed_datas['iTotalRecords'] = $feed_datas['iTotalRecords'] - $minus_has_delivery_rates;
$feed_datas['iTotalDisplayRecords'] = $feed_datas['iTotalDisplayRecords'] - $minus_has_delivery_rates;
if ($feed_datas['iTotalRecords'] <= 0) {
$this->otableNodata();
}
}
$this->otableOutput($feed_datas);
}
}
$this->otableNodata();
}