Exemple #1
0
 /**
  * 用户列表
  */
 public function listAction()
 {
     $iPage = intval($this->getParam('page'));
     $aWhere = array();
     $aParam = $this->getParams();
     if (!empty($aParam['iType'])) {
         $aWhere['iType'] = $aParam['iType'];
     }
     if (!empty($aParam['iCoIndustry'])) {
         $aWhere['iCoIndustry'] = $aParam['iCoIndustry'];
     }
     if (!empty($aParam['sEmail'])) {
         $aWhere['sEmail LIKE'] = '%' . $aParam['sEmail'] . '%';
     }
     if (!empty($aParam['sMobile'])) {
         $aWhere['sMobile LIKE'] = '%' . $aParam['sMobile'] . '%';
     }
     if (!empty($aParam['iStatus'])) {
         $aWhere['iStatus'] = $aParam['iStatus'];
     } else {
         $aWhere['iStatus IN'] = '1,2';
     }
     $aList = Model_User::getList($aWhere, $iPage, $this->getParam('sOrder', ''));
     $this->assign('aList', $aList);
     $this->assign('aParam', $aParam);
     $this->assign('aBusiness', Model_Domain::getPairDomain(Model_Domain::TYPE_CO_INDUSTRY));
     //行业
 }
Exemple #2
0
 public function action_index()
 {
     // creamos el layout o template principal
     $template = View::factory('Template');
     // Asignamos variables al template
     $template->title = "Titulo de prueba";
     $template->description = "Descripción de prueba";
     // creamos un subtemplate (por ejemplo el template de la sección welcome)
     $welcome = View::factory('welcome');
     // asignamos variables a subtemplate
     $welcome->title = "GCRM para Grado Superior";
     // creamos modelo
     $user = new Model_User();
     // seteamos lista de usuarios
     $welcome->users = $user->getList();
     // cargamos subtemplate
     $template->content = $welcome;
     // mostramos el template
     $this->response->body($template);
 }
Exemple #3
0
 public function couriersAction()
 {
     $oRequest = App_Request::getInstance();
     if ('admin' == App_Auth::getInstance()->getIdentity()->user_type) {
         $oUserModel = new Model_User();
         $oUserModel->setOption('type', 'courier');
         $this->view->couriers = $oUserModel->getList();
     } else {
         $this->view->setView('admin/noperms.phtml');
     }
 }
<?php

require_once __DIR__ . '/../src/core.php';
CronRunner::run(__FILE__, function ($logger) {
    $userCount = Model_User::getCount();
    echo "User Count: " . Model_User::getCount() . PHP_EOL;
    foreach (Model_User::getList() as $key) {
        echo $key['name'] . PHP_EOL;
    }
    $mediaCount = [];
    $distArr = [];
    foreach (Media::getConstList() as $media) {
        $distArr[$media] = [];
        $mediaCount[$media] = Model_Media::getCount($media);
    }
    foreach (Media::getConstList() as $media) {
        $localDist = Model_MixedUserMedia::getRatingDistribution($media);
        foreach ($localDist->getGroupsKeys() as $key) {
            if (!isset($distArr[$media][$key])) {
                $distArr[$media][$key] = 0;
            }
            $distArr[$media][$key] += $localDist->getGroupSize($key);
        }
    }
    $globalsCache = ['user-count' => $userCount, 'media-count' => $mediaCount, 'rating-dist' => $distArr];
    TextHelper::putJson(Config::$globalsCachePath, $globalsCache);
});