本文整理汇总了PHP中Coupon::deleteSelection方法的典型用法代码示例。如果您正苦于以下问题:PHP Coupon::deleteSelection方法的具体用法?PHP Coupon::deleteSelection怎么用?PHP Coupon::deleteSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coupon
的用法示例。
在下文中一共展示了Coupon::deleteSelection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Coupon
<?php
if (intval(Tools::G('delete')) > 0) {
$object = new Coupon(intval(Tools::getRequest('delete')));
if (Validate::isLoadedObject($object)) {
$object->delete();
}
if (is_array($object->_errors) and count($object->_errors) > 0) {
$errors = $object->_errors;
} else {
UIAdminAlerts::conf('优惠码已删除');
}
} elseif (Tools::isSubmit('subDelete')) {
$select_cat = Tools::getRequest('categoryBox');
$coupon = new Coupon();
if ($coupon->deleteSelection($select_cat)) {
UIAdminAlerts::conf('优惠码已删除');
}
} elseif (intval(Tools::getRequest('toggleStatus')) > 0) {
$object = new Coupon(intval(Tools::getRequest('toggleStatus')));
if (Validate::isLoadedObject($object)) {
$object->toggleStatus();
}
if (is_array($object->_errors) and count($object->_errors) > 0) {
$errors = $object->_errors;
} else {
UIAdminAlerts::conf('优惠码已更新');
}
}
$table = new UIAdminTable('coupon', 'Coupon', 'id_coupon');
$table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_coupon', 'title' => 'ID', 'width' => '80px', 'filter' => 'string'), array('name' => 'id_user', 'title' => '状态码', 'filter' => 'string'), array('name' => 'off', 'title' => '状态信息', 'filter' => 'string'), array('name' => 'amount', 'title' => '状态信息', 'filter' => 'string'), array('name' => 'active', 'title' => '状态信息', 'filter' => 'string'), array('name' => 'add_date', 'title' => '状态信息', 'filter' => 'string'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete')));