人人商城

default.ctrl.php 733B

12345678910111213141516171819
  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. $acid = intval($_GPC['acid']);
  8. $uniacid = intval($_GPC['uniacid']);
  9. $accounts = uni_accounts($uniacid);
  10. $accounts_acids = array_keys($accounts);
  11. $account = account_fetch($acid);
  12. if($acid > 0 && in_array($acid, $accounts_acids)) {
  13. pdo_update('uni_account', array('name' => $account['name'], 'default_acid' => $acid), array('uniacid' => $uniacid));
  14. cache_delete("uniaccount:{$uniacid}");
  15. message('设置默认公众号成功', referer(), 'success');
  16. }
  17. message('公众号不存在或已经删除', referer(), 'error');