当前位置: 首页>>代码示例>>PHP>>正文


PHP Restaurant::multipleFind方法代码示例

本文整理汇总了PHP中Restaurant::multipleFind方法的典型用法代码示例。如果您正苦于以下问题:PHP Restaurant::multipleFind方法的具体用法?PHP Restaurant::multipleFind怎么用?PHP Restaurant::multipleFind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Restaurant的用法示例。


在下文中一共展示了Restaurant::multipleFind方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Session

<?php

require_once 'model/session.php';
require_once 'model/restaurant.php';
require_once 'model/order.php';
$session = new Session();
$order = new Order();
$restaurant = new Restaurant();
$user_id = $session->get_session_data('id');
$restaurants = $restaurant->multipleFind('owner_id', $user_id);
$size = sizeof($restaurants);
$restaurant_ids = [];
$count = 1;
$arr = "(";
foreach ($restaurants as $key => $value) {
    if ($count == $size) {
        $arr .= $value['id'];
    } else {
        $arr .= $value['id'] . ",";
    }
    $count += 1;
}
$result = $order->execSQL('SELECT *,`order`.`id` as `orderId`,`order`.`status` as `orderStatus` FROM `order` INNER JOIN `users` ON `users`.`id` = `order`.`user_id` INNER JOIN `restaurant` ON `restaurant`.`id` = `order`.`restaurant_id` INNER JOIN `credit_cards` ON `credit_cards`.`id` = `order`.`card_id` INNER JOIN `delivery_address` ON `delivery_address`.`id` = `order`.`address_id` WHERE `order`.`restaurant_id` IN ' . $arr . ');');
$data = [];
while ($row = mysqli_fetch_object($result)) {
    array_push($data, (array) $row);
}
?>

<!DOCTYPE html>
<html lang="en">
开发者ID:manikanthtalasu,项目名称:restaurant-finder,代码行数:31,代码来源:owner-track-order.php

示例2: Restaurant

?>
	<div class="container" style="margin-top:100px;margin-bottom:50px;min-height: 500px;">
		<?php 
if ($session->session_exist('user_type')) {
    ?>
		<?php 
    if ($session->get_session_data('user_type') == 'restaurant_owner') {
        ?>

		<h1>Your Restaurants</h1>
		<a href="new_restaurant.php" class="btn btn-warning" style="float:right;margin-top:-40px"><i class="fa fa-plus"></i> Add new restaurant</a>
		<div>
			<div class="col-sm-8">
			<?php 
        $restaurant = new Restaurant();
        $data = $restaurant->multipleFind('owner_id', $session->get_session_data('id'));
        // var_dump($data);
        foreach ($data as $key => $value) {
            echo '<div class="row" restaurant-id="' . $value['id'] . '">
				<div class="col-sm-2">
				<a href="/view-restaurant.php?id=' . $value['id'] . '"><img src=".' . $value['image'] . '" height="90px" width="90px"></a>
				</div>
				<div class="col-sm-6">
				<a href="/view-restaurant.php?id=' . $value['id'] . '"><h4>' . ($key + 1) . '. ' . $value['name'] . '</h4></a>
				<h4>' . $value['rating'] . ' star rating ' . $value['review_count'] . ' reviews</h4>';
            switch ((int) $value['status']) {
                case 1:
                    echo '<span class="label label-success">Approved</span>';
                    break;
                case 2:
                    echo '<span class="label label-warning">Blocked</span>';
开发者ID:manikanthtalasu,项目名称:restaurant-finder,代码行数:31,代码来源:dashboard.php


注:本文中的Restaurant::multipleFind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。