本文整理汇总了PHP中module_controller::samepackage方法的典型用法代码示例。如果您正苦于以下问题:PHP module_controller::samepackage方法的具体用法?PHP module_controller::samepackage怎么用?PHP module_controller::samepackage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module_controller
的用法示例。
在下文中一共展示了module_controller::samepackage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ExecuteDeletePackage
static function ExecuteDeletePackage($pk_id_pk, $mpk_id_pk)
{
global $zdbh;
$sql = $zdbh->prepare("SELECT COUNT(*) FROM x_accounts WHERE ac_package_fk=:packageid AND ac_deleted_ts IS NULL");
$sql->bindParam(':packageid', $pk_id_pk);
$sql->execute();
$numrows = $sql->fetchAll();
if ($numrows[0] != 0) {
if ($pk_id_pk == $mpk_id_pk) {
self::$samepackage = true;
return false;
}
}
runtime_hook::Execute('OnBeforeDeletePackage');
$sql = $zdbh->prepare("\n UPDATE x_accounts\n SET ac_package_fk = :mpk_id_pk\n WHERE ac_package_fk =:pk_id_pk");
$sql->bindParam(':mpk_id_pk', $mpk_id_pk);
$sql->bindParam(':pk_id_pk', $pk_id_pk);
$sql->execute();
$sql = $zdbh->prepare("\n UPDATE x_profiles\n SET ud_package_fk = :mpk_id_pk\n WHERE ud_package_fk = :pk_id_pk");
$sql->bindParam(':mpk_id_pk', $mpk_id_pk);
$sql->bindParam(':pk_id_pk', $pk_id_pk);
$sql->execute();
$sql = $zdbh->prepare("\n\t\t\tUPDATE x_packages\n\t\t\tSET pk_deleted_ts = :time\n\t\t\tWHERE pk_id_pk = :pk_id_pk");
$time = time();
$sql->bindParam(':time', $time);
$sql->bindParam(':pk_id_pk', $pk_id_pk);
$sql->execute();
runtime_hook::Execute('OnAfterDeletePackage');
self::$ok = true;
return true;
}