文件
mashangyoujiu/Application/Admin/Controller/IndexController.class.php

66 行
1.9 KiB
PHP
可执行文件

<?php
namespace Admin\Controller;
use Common\Model\RetailAgentModel;
use Common\Model\RetailMerchantModel;
//[1.9.5]
class IndexController extends BaseController
{
/**
* 首页展示
*/
public function home()
{
// 总商户数
$map = [
'status' => ['in', '1,2']
];
$MerchantModel = new RetailMerchantModel();
$allshop = $MerchantModel->getCount($map);
$this->assign('allshop', $allshop);
//总代理商数
$AgentModel = new RetailAgentModel();
$map = [
'status' => ['in', '1,2']
];
$count = $AgentModel->getCount($map);
$this->assign('allMerchant', $count);
//使用中的代理商数
$map = [
'status' => 1,
'end_time' => ['gt', time()],
];
$normalMerchant = $AgentModel->getCount($map);
$this->assign('normalMerchant', $normalMerchant);
//已过期的代理商数
$map['end_time'] = ['lt', time()];
$overdueMerchant = $AgentModel->getCount($map);
$this->assign('overdueMerchant', $overdueMerchant);
// 读取最新插件
$plug = M("plug")->order("addtime desc")->limit(5)->select();
$this->assign("plug", $plug);
//新大陆调转链接
$this->assign('newContinentUrl', 'https://starpos.com.cn:8180/portal/login?url=portal');
$arr = array(
'update' => '/index.php/Super/Version/update',
'checkVersion' => '/index.php/Super/Version/checkVersion',
'MessageIndex' => '/index.php/Super/Message/index',
'see' => '/index.php/Super/Message/see',
'WorkMessageIndex' => '/index.php/Super/WorkMessage/index',
'DemandIndex' => '/index.php/Super/Demand/index',
);
$authArr = checkFunction($arr);
$this->assign('authArr', $authArr);
$this->display();
}
}