sync.ctrl.php 796 B

12345678910111213141516171819202122
  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()->model('account');
  8. load()->model('mc');
  9. if(!empty($_W['uniacid'])) {
  10. $setting = uni_setting($_W['uniacid'], array('sync'));
  11. $sync_setting = $setting['sync'];
  12. if($sync_setting == 1 && $_W['account']['type'] == 1 && $_W['account']['level'] >= ACCOUNT_TYPE_OFFCIAL_AUTH) {
  13. $fans = pdo_getall('mc_mapping_fans', array('uniacid' => $_W['uniacid'], 'follow' => 1), array('fanid', 'openid', 'acid', 'uid', 'uniacid'), 'fanid', array('updatetime ASC', 'fanid DESC'), '10');
  14. if(!empty($fans)) {
  15. foreach($fans as $row) {
  16. mc_init_fans_info($row['openid']);
  17. }
  18. }
  19. }
  20. }