<?php

namespace web\admin;

class welcome {
    public static function json_init() {
        global $db;
        $works = array();
        
        $csql = new \ciy\sql('ap_usr_real_apply');
        $csql->where("auditstatus=20");
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '用户实名审核 待审批' . $cnt . '条', 'url' => 'expo/usr_real_apply.html?liid=20', 'tab' => '实名审核');

        $csql = new \ciy\sql('ap_usr_collect_apply');
        $csql->where("auditstatus=20");
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '采集员申请 待审批' . $cnt . '条', 'url' => 'expo/usr_collect_apply.html?liid=20', 'tab' => '采集员审核');

        $csql = new \ciy\sql('ap_usr_opwork_apply');
        $csql->where("auditstatus=20");
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '运营官申请 待审批' . $cnt . '条', 'url' => 'expo/usr_opwork_apply.html?liid=20', 'tab' => '运营官审核');

        $csql = new \ciy\sql('ap_expo_collect');
        $csql->where("collectstatus=10");
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '展会采集工作申请 待审批' . $cnt . '条', 'url' => 'expo/expo_collect.html?liid=10', 'tab' => '采集申请审核');

        $csql = new \ciy\sql('ap_expositioz_apply');
        $csql->where("collectstatus=10");
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '展会运营官申请 待审批' . $cnt . '条', 'url' => 'expo/expositioz_apply.html?liid=20', 'tab' => '展会运营官审核');

        $csql = new \ciy\sql('ap_expo_service');
        $csql->where("ctuser=0");
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '逛展客户预约 待联系' . $cnt . '条', 'url' => 'expo/expo_service.html?liid=1', 'tab' => '逛展预约单');

        $csql = new \ciy\sql('ap_exposition');
        $csql->where("inducateid=0");
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '逛展客户预约 未分类' . $cnt . '条', 'url' => 'expo/ai_expo_cate.html', 'tab' => 'AI展会分类');

        $csql = new \ciy\sql('c_fair_juzhan_pavi');
        $csql->where('status=0');
        $csql->where('diqu like ', '中国-');
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '新国内展馆 发现' . $cnt . '条', 'url' => 'expo/sdby_pavi.html', 'tab' => '补充展馆');

        $csql = new \ciy\sql('ap_socgrouz_apply');
        $csql->where("auditstatus=20");
        $cnt = (int)$db->get1($csql);
        if ($cnt > 0)
            $works[] = array('title' => '社群更新 待审批' . $cnt . '条', 'url' => 'expo/socgrouz_apply.html?liid=20', 'tab' => '社群更新审核');

        $ret['works'] = $works;
        return succjson($ret);
    }
}
