Ejemplo n.º 1
0
            $vip_list = array_sort($vip_list, 'upgrade_gap', $sort_type);
        }
    }
    $sort_type = $sort_type == 'DESC' ? 'ASC' : 'DESC';
    $smarty->assign('sort_type', $sort_type);
    $smarty->assign('rank_id', $rank_id);
    $smarty->assign('filter', $filter);
    $smarty->assign('condition', $condition);
    $smarty->assign('section', 'by_rank');
    $smarty->assign('rank_list', $vip_list);
    if ($_REQUEST['from_sel']) {
        $res['record_count'] = $filter['record_count'];
        $res['response_action'] = 'search_service';
        $res['main'] = $smarty->fetch('vip_part.htm');
    } else {
        $smarty->assign('platform', platform_list());
        $smarty->assign('user_rank', $user_rank);
        $res['main'] = $smarty->fetch('vip_list.htm');
    }
    die($json->encode($res));
} elseif ($_REQUEST['act'] == 'user_buy_list') {
    /* 检查权限 */
    admin_priv('users_list');
    $res = array('switch_tag' => true, 'id' => $_REQUEST['tag'] ? $_REQUEST['tag'] : 0);
    if ($_SESSION['admin_id'] == 78) {
        $_REQUEST['type'] = '13';
    } elseif (!$_REQUEST['type']) {
        $_REQUEST['type'] = '2, 3, 4, 5, 11';
    }
    $smarty->assign('user_ranks', $ranks);
    $smarty->assign('ur_here', $_LANG['01_users_list']);
Ejemplo n.º 2
0
function sales_stats($start, $end)
{
    $pwd_info = authority_judge();
    if ($pwd_info['company_mgr']) {
        $platform_list = platform_list();
    }
    $tidy_date = tidysql();
    extract($tidy_date);
    //部门排行
    if ($pwd_info['company_mgr'] || $pwd_info['statistic_part_mgr']) {
        $sql_role_ranklist = " GROUP BY platform ";
        $sales['role_ranklist'] = get_ranklist($sql_role_ranklist, 'role_ranklist', $start, $end);
    }
    //团队排行
    if ($pwd_info['statistic_part_mgr']) {
        $sql_group_ranklist = " AND platform={$_SESSION['role_id']}";
    }
    $sales['group_ranklist'] = get_ranklist($sql_group_ranklist, 'group_ranklist', $start, $end);
    //成交订单排行
    if ($pwd_info['statistic_part_mgr']) {
        $sql_finish_order_ranklist = " AND platform={$_SESSION['role_id']} ";
    } elseif ($pwd_info['statistic_group_mgr']) {
        //$sql_finish_order_ranklist = " AND platform={$_SESSION['role_id']} AND group_id={$_SESSION['group_id']} ";
        $sql_finish_order_ranklist = " AND platform={$_SESSION['role_id']} AND group_id={$_SESSION['group_id']} GROUP BY admin_id ";
    }
    $sales['finish_order_ranklist'] = get_ranklist($sql_finish_order_ranklist, 'finish_order_ranklist', $start, $end);
    //个人排行
    $sales['person_ranklist'] = get_ranklist($sql_person_ranklist, 'personal_ranklist', $start, $end);
    return $sales;
}
Ejemplo n.º 3
0
         if ($error_shiping) {
             $msg .= '<br/>' . $_LANG['shipping_no_error'] . implode(',', $error_shiping);
         }
         if (!$msg) {
             $msg = $_LANG['syn_success'];
         }
     } else {
         $msg = $_LANG['verify_error'];
     }
     die($json->encode($msg));
     //$shippig_code_list = trim($_REQUEST['shipping_code_list']);
     //$plarform = intval($_REQUEST['platform']);
     break;
 case 'show':
     admin_priv('all', '', false) && $smarty->assign('all', true);
     $smarty->assign('platform_list', platform_list(explode(',', ONLINE_STORE), true));
     $smarty->assign('shipping_list', shipping_list(3));
     if ($_SESSION['role_id'] == 10 || admin_priv('all', '', false)) {
         $smarty->assign('all', true);
     }
     $res['main'] = $smarty->fetch('deal_flush_order.htm');
     die($json->encode($res));
     break;
 case 'mark':
     //标记刷单->删除商品->进入发货流程
     $order_sn_list = trim(mysql_real_escape_string($_REQUEST['orderlist']));
     if ($order_sn_list) {
         $order_sn_list = str_replace('\\n', '', $order_sn_list);
         //$order_sn_list = preg_replace('/#+/',',',$order_sn_list);
         $order_sn_list = preg_split('/#+/', $order_sn_list);
         $order_sn_list = array_filter($order_sn_list);
Ejemplo n.º 4
0
        }
    }
    foreach ($service_list as &$v) {
        $v['add_time'] = date('Y-m-d', $v['add_time']);
    }
    $smarty->assign('service_list', $service_list);
    $res['main'] = $smarty->fetch('service_all_list.htm');
    die($json->encode($res));
} elseif ($_REQUEST['act'] == 'service_record_all_list') {
    $res = array();
    $res['left'] = sub_menu_list($file);
    if ($res['left'] === false) {
        unset($res['left']);
    }
    $counsel_list = counsel_list();
    $platform_list = platform_list();
    if (admin_priv('counsel_list_all', '', false)) {
        array_unshift($platform_list, array('role_name' => '全部', 'role_id' => 0));
    }
    foreach ($counsel_list['counsel_list'] as &$val) {
        if ($val['success_deal']) {
            $val['deal_rate'] = round($val['success_deal'] / $val['guide_consulting'] * 100, 2) . '%';
        }
    }
    $smarty->assign('counsel_list', $counsel_list['counsel_list']);
    $smarty->assign('platform_list', $platform_list);
    $smarty->assign('daytime', time() + 28800);
    $smarty->assign('curr_title', '顾客咨询记录');
    $smarty->assign('num', sprintf('(共%d条记录)', $counsel_list['record_count']));
    // 分页设置
    $smarty->assign('filter', $counsel_list['filter']);
Ejemplo n.º 5
0
function report_authority(&$status, &$refund_where, &$trans_role_list)
{
    if (admin_priv('order_sales_all', '', false)) {
        $stats_list = explode(',', SALE . ',' . ONLINE_STORE);
        $stats_list = array_unique($stats_list);
        $stats_list = implode(',', $stats_list);
    } elseif (admin_priv('order_sales_trans-part', '', false)) {
        $trans_role_list = trans_part_list();
        $stats_list = @implode(',', $trans_role_list);
    } elseif (admin_priv('order_sales_part', '', false)) {
        $platform_stats = platform_list();
        foreach ($platform_stats as $val) {
            $stats_list[] = $val['role_id'];
        }
        $stats_list = @implode(',', $stats_list);
    } elseif (admin_priv('order_sales_branch', '', false)) {
        $sql_select = 'SELECT action FROM ' . $GLOBALS['ecs']->table('role') . " WHERE role_id={$_SESSION['role_id']}";
        $action = $GLOBALS['db']->getOne($sql_select);
        $sql_select = 'SELECT role_id FROM ' . $GLOBALS['ecs']->table('role') . " WHERE action='{$action}'";
        $role_list = $GLOBALS['db']->getCol($sql_select);
        $stats_list = implode(',', $role_list);
    }
    return $stats_list;
}