本文整理汇总了PHP中Purchase::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Purchase::delete方法的具体用法?PHP Purchase::delete怎么用?PHP Purchase::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Purchase
的用法示例。
在下文中一共展示了Purchase::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Orders admin flow handlers
*/
function orders_list()
{
global $Shopp, $Orders;
$db = DB::get();
$defaults = array('page' => false, 'deleting' => false, 'selected' => false, 'update' => false, 'newstatus' => false, 'pagenum' => 1, 'per_page' => false, 'start' => '', 'end' => '', 'status' => false, 's' => '', 'range' => '', 'startdate' => '', 'enddate' => '');
$args = array_merge($defaults, $_GET);
extract($args, EXTR_SKIP);
if (!current_user_can(SHOPP_USERLEVEL)) {
wp_die(__('You do not have sufficient permissions to access this page.', 'Shopp'));
}
if ($page == "shopp-orders" && !empty($deleting) && !empty($selected) && is_array($selected)) {
foreach ($selected as $selection) {
$Purchase = new Purchase($selection);
$Purchase->load_purchased();
foreach ($Purchase->purchased as $purchased) {
$Purchased = new Purchased($purchased->id);
$Purchased->delete();
}
$Purchase->delete();
}
}
$statusLabels = $this->Settings->get('order_status');
if (empty($statusLabels)) {
$statusLabels = array('');
}
$txnStatusLabels = array('PENDING' => __('Pending', 'Shopp'), 'CHARGED' => __('Charged', 'Shopp'), 'REFUNDED' => __('Refunded', 'Shopp'), 'VOID' => __('Void', 'Shopp'));
if ($update == "order" && !empty($selected) && is_array($selected)) {
foreach ($selected as $selection) {
$Purchase = new Purchase($selection);
$Purchase->status = $newstatus;
$Purchase->save();
}
}
$Purchase = new Purchase();
if (!empty($start)) {
$startdate = $start;
list($month, $day, $year) = explode("/", $startdate);
$starts = mktime(0, 0, 0, $month, $day, $year);
}
if (!empty($end)) {
$enddate = $end;
list($month, $day, $year) = explode("/", $enddate);
$ends = mktime(23, 59, 59, $month, $day, $year);
}
$pagenum = absint($pagenum);
if (empty($pagenum)) {
$pagenum = 1;
}
if (!$per_page || $per_page < 0) {
$per_page = 20;
}
$start = $per_page * ($pagenum - 1);
$where = '';
if (!empty($status) || $status === '0') {
$where = "WHERE status='{$status}'";
}
if (!empty($s)) {
$s = stripslashes($s);
if (preg_match_all('/(\\w+?)\\:(?="(.+?)"|(.+?)\\b)/', $s, $props, PREG_SET_ORDER) > 0) {
foreach ($props as $search) {
$keyword = !empty($search[2]) ? $search[2] : $search[3];
switch (strtolower($search[1])) {
case "txn":
$where .= (empty($where) ? "WHERE " : " AND ") . "transactionid='{$keyword}'";
break;
case "gateway":
$where .= (empty($where) ? "WHERE " : " AND ") . "gateway LIKE '%{$keyword}%'";
break;
case "cardtype":
$where .= (empty($where) ? "WHERE " : " AND ") . "cardtype LIKE '%{$keyword}%'";
break;
case "address":
$where .= (empty($where) ? "WHERE " : " AND ") . "(address LIKE '%{$keyword}%' OR xaddress='%{$keyword}%')";
break;
case "city":
$where .= (empty($where) ? "WHERE " : " AND ") . "city LIKE '%{$keyword}%'";
break;
case "province":
case "state":
$where .= (empty($where) ? "WHERE " : " AND ") . "state='{$keyword}'";
break;
case "zip":
case "zipcode":
case "postcode":
$where .= (empty($where) ? "WHERE " : " AND ") . "postcode='{$keyword}'";
break;
case "country":
$where .= (empty($where) ? "WHERE " : " AND ") . "country='{$keyword}'";
break;
}
}
if (empty($where)) {
$where .= (empty($where) ? "WHERE " : " AND ") . " (id='{$s}' OR CONCAT(firstname,' ',lastname) LIKE '%{$s}%')";
}
} elseif (strpos($s, '@') !== false) {
$where .= (empty($where) ? "WHERE " : " AND ") . " email='{$s}'";
} else {
//.........这里部分代码省略.........