本文整理汇总了PHP中Generic::setCurrentDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Generic::setCurrentDate方法的具体用法?PHP Generic::setCurrentDate怎么用?PHP Generic::setCurrentDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generic
的用法示例。
在下文中一共展示了Generic::setCurrentDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reportFee
public function reportFee()
{
$id_restaurant = isset($_GET['id_restaurant']) ? addslashes($_GET['id_restaurant']) : "0";
$type_order = isset($_GET['type_order']) ? addslashes($_GET['type_order']) : "8";
$dateVon = isset($_GET['dateVon']) ? addslashes($_GET['dateVon']) : date('Y-m-d', time());
$dateBis = isset($_GET['dateBis']) ? addslashes($_GET['dateBis']) : date('Y-m-d', time());
// $dateBis = isset($_GET['dateBis']) ? addslashes($_GET['dateBis']) : Generic::setCurrentDate();
$id_server = isset($_GET['id_server']) ? addslashes($_GET['id_server']) : "0";
$status_payment = isset($_GET['status_payment']) ? addslashes($_GET['status_payment']) : 0;
$status_progress = isset($_GET['status_progress']) ? addslashes($_GET['status_progress']) : 4;
$objResto = new MasterRestaurantModel();
$arrResto = $objResto->getAll();
$arrRestoIndex[0] = "All";
foreach ($arrResto as $resto) {
if ($resto->name != "") {
$arrRestoIndex[$resto->id_restaurant] = $resto->name;
}
}
$objOrder = new MasterOrderModel();
$first_key = key($arrRestoIndex);
$arrOrder = $objOrder->getWhere("id_restaurant='{$id_restaurant}'");
$arrRestoUserIndex[0] = "All";
foreach ($arrOrder as $val) {
$user = RestaurantUser::getRestaurantUserName($val->id_server);
if ($user != "") {
$arrRestoUserIndex[$val->id_server] = $user;
}
}
$arrTypeOrder[0] = "Dine In - Manual";
$arrTypeOrder[1] = "Dine In - Apps";
$arrTypeOrder[2] = "Take Away - Manual";
$arrTypeOrder[3] = "Take Away - Apps";
$arrTypeOrder[4] = "All Manual Order";
$arrTypeOrder[5] = "All Apps Order";
$arrTypeOrder[6] = "All Dine In Order";
$arrTypeOrder[7] = "All Take Away Order";
$arrTypeOrder[8] = "All Order Types";
$arrStatusPaymentMethod[1] = "Cash";
$arrStatusPaymentMethod[2] = "Credit Card";
$arrStatusPaymentMethod[3] = "Others";
$arrStatusPaymentMethod[0] = "All Payment Method";
$arrStatusProgress[4] = "Done";
$arrStatusProgress[9] = "Void";
$t = time();
$where = " ";
if ($id_restaurant == 0) {
$where = $where;
} else {
$allResto = false;
$where = $where . " resto.id_restaurant='{$id_restaurant}' AND ";
}
if ($type_order == "8") {
} else {
$where = $where . " o.type_order='{$type_order}' AND ";
}
if ($dateVon == "") {
?>
<?php
$dateVon = Generic::setCurrentDate();
} else {
$date = new DateTime($dateVon);
// $dateVon = leap_mysqldate_isi(date('Y-m-d H:i:s'));
// pr($dateVon);
$where = $where . " o.datetime_order >='{$dateVon}' AND ";
}
if ($dateBis == "") {
$dateBis = Generic::setCurrentDate();
} else {
$date = new DateTime($dateVon);
$where = $where . " o.datetime_order <= '{$dateBis}' AND ";
}
if ($id_server == "0") {
$where = $where;
} else {
$where = $where . " o.id_server='{$id_server}' AND ";
}
if ($status_payment == "" | $status_payment == "0") {
$where = $where;
} else {
$where = $where . " o.status_payment='{$status_payment}' AND ";
}
if ($status_progress == "") {
} else {
$where = $where . " o.status_progress='{$status_progress}' ";
}
$objOrder = new MasterOrderModel();
$objResto = new MasterRestaurantModel();
$objOrderDetail = new OrderDetailModel();
$objDish = new MasterDishModel();
global $db;
$q = "SELECT o.datetime_order as dateOrder,o.datetime_order as timeOrder , resto.name, o.id_order, o.mr_fee, o.cc_fee, o.mr_fee+o.cc_fee as Total FROM {$objResto->table_name} resto INNER JOIN {$objOrder->table_name} o ON resto.id_restaurant = o.id_restaurant";
// $q = $q . " INNER JOIN {$objOrderDetail->table_name} orderdetail ON o.id_order = orderdetail.id_order ";
// $q = $q . " INNER JOIN {$objDish->table_name} dish ON orderdetail.id_dish = dish.id_dish ";
$q = $q . " WHERE " . $where;
// pr($q);
$arrQuery = $db->query($q, 2);
// pr($arrQuery);
// die();
// $data = json_encode($arrQuery);
$data = $arrQuery;
//.........这里部分代码省略.........