人人商城

delete.ctrl.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. load()->func('file');
  8. $uniacid = intval($_GPC['uniacid']);
  9. $acid = intval($_GPC['acid']);
  10. if (!empty($acid) && empty($uniacid)) {
  11. $account = account_fetch($acid);
  12. if (empty($account)) {
  13. message('子公众号不存在或是已经被删除');
  14. }
  15. $state = uni_permission($uid, $uniacid);
  16. if($state != 'founder' && $state != 'manager') {
  17. message('没有该公众号操作权限!', url('accound/display'), 'error');
  18. }
  19. $uniaccount = uni_fetch($account['uniacid']);
  20. if ($uniaccount['default_acid'] == $acid) {
  21. message('默认子公众号不能删除');
  22. }
  23. pdo_update('account', array('isdeleted' => 1), array('acid' => $acid));
  24. message('删除子公众号成功!', referer(), 'success');
  25. }
  26. if (!empty($uniacid)) {
  27. $account = pdo_fetch("SELECT * FROM ".tablename('uni_account')." WHERE uniacid = :uniacid", array(':uniacid' => $uniacid));
  28. if (empty($account)) {
  29. message('抱歉,帐号不存在或是已经被删除', url('account/display'), 'error');
  30. }
  31. $state = uni_permission($uid, $uniacid);
  32. if($state != 'founder' && $state != 'manager') {
  33. message('没有该公众号操作权限!', url('accound/display'), 'error');
  34. }
  35. pdo_update('account', array('isdeleted' => 1), array('acid' => $acid));
  36. }
  37. message('公众帐号信息删除成功!', url('account/display'), 'success');