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


PHP Discount::deleteByIdCustomer方法代码示例

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


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

示例1: delete

 public function delete()
 {
     $addresses = $this->getAddresses((int) Configuration::get('PS_LANG_DEFAULT'));
     foreach ($addresses as $address) {
         $obj = new Address((int) $address['id_address']);
         $obj->delete();
     }
     Db::getInstance()->Execute('DELETE FROM `' . _DB_PREFIX_ . 'customer_group` WHERE `id_customer` = ' . (int) $this->id);
     Discount::deleteByIdCustomer((int) $this->id);
     return parent::delete();
 }
开发者ID:khuyennd,项目名称:dev-tasagent,代码行数:11,代码来源:Company.php

示例2: postProcess


//.........这里部分代码省略.........
                } else {
                    if ($this->tabAccess['add'] === '1') {
                        $object = new $this->className();
                        $this->copyFromPost($object, $this->table);
                        if (!$object->add()) {
                            $this->_errors[] = Tools::displayError('An error occurred while creating object.') . ' <b>' . $this->table . ' (' . mysql_error() . ')</b>';
                        } elseif ($_POST[$this->identifier] = $object->id and $this->postImage($object->id) and !sizeof($this->_errors) and $this->_redirect) {
                            // Add Associated groups
                            $group_list = Tools::getValue('groupBox');
                            if (is_array($group_list) && sizeof($group_list) > 0) {
                                $object->addGroups($group_list, true);
                            }
                            $parent_id = (int) Tools::getValue('id_parent', 1);
                            // Save and stay on same form
                            if (Tools::isSubmit('submitAdd' . $this->table . 'AndStay')) {
                                Tools::redirectAdmin($currentIndex . '&' . $this->identifier . '=' . $object->id . '&conf=3&update' . $this->table . '&token=' . $this->token);
                            }
                            // Save and back to parent
                            if (Tools::isSubmit('submitAdd' . $this->table . 'AndBackToParent')) {
                                Tools::redirectAdmin($currentIndex . '&' . $this->identifier . '=' . $parent_id . '&conf=3&token=' . $this->token);
                            }
                            // Default behavior (save and back)
                            Tools::redirectAdmin($currentIndex . ($parent_id ? '&' . $this->identifier . '=' . $object->id : '') . '&conf=3&token=' . $this->token);
                        }
                    } else {
                        $this->_errors[] = Tools::displayError('You do not have permission to add here.');
                    }
                }
            }
        } elseif (Tools::isSubmit('delete' . $this->table) and $this->tabAccess['delete'] === '1') {
            switch (Tools::getValue('deleteMode')) {
                case 'real':
                    $this->deleted = false;
                    Discount::deleteByIdCustomer((int) Tools::getValue('id_customer'));
                    break;
                case 'deleted':
                    $this->deleted = true;
                    break;
                default:
                    echo $deleteForm;
                    if (isset($_POST['delete' . $this->table])) {
                        unset($_POST['delete' . $this->table]);
                    }
                    if (isset($_GET['delete' . $this->table])) {
                        unset($_GET['delete' . $this->table]);
                    }
                    break;
            }
        } elseif (Tools::isSubmit('submitDel' . $this->table) and $this->tabAccess['delete'] === '1') {
            switch (Tools::getValue('deleteMode')) {
                case 'real':
                    $this->deleted = false;
                    foreach (Tools::getValue('customerBox') as $id_customer) {
                        Discount::deleteByIdCustomer((int) $id_customer);
                    }
                    break;
                case 'deleted':
                    $this->deleted = true;
                    break;
                default:
                    echo $deleteForm;
                    if (isset($_POST['submitDel' . $this->table])) {
                        unset($_POST['submitDel' . $this->table]);
                    }
                    if (isset($_GET['submitDel' . $this->table])) {
                        unset($_GET['submitDel' . $this->table]);
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:67,代码来源:AdminCustomers.php

示例3: processDelete

 public function processDelete()
 {
     if ($this->delete_mode == 'real') {
         $this->deleted = false;
         Discount::deleteByIdCustomer((int) Tools::getValue('id_customer'));
     } elseif ($this->delete_mode == 'deleted') {
         $this->deleted = true;
     } else {
         $this->errors[] = Tools::displayError('Unknown delete mode:') . ' ' . $this->deleted;
         return;
     }
     parent::processDelete();
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:13,代码来源:AdminCustomersController.php


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