优化ctms-api语法、修复已知BUG;
主要修复ctms-api、dacms对PHP新版本的支持问题
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* User: Administrator
|
||||
* Date: 2016-7-5
|
||||
* Time: 16:10
|
||||
* Description:
|
||||
*/
|
||||
|
||||
namespace backend\components;
|
||||
|
||||
|
||||
use Yii;
|
||||
use yii\rbac\Rule;
|
||||
|
||||
|
||||
class ArticleRule extends Rule
|
||||
{
|
||||
public $name = 'article';
|
||||
|
||||
public function execute($user, $item, $params)
|
||||
{
|
||||
// 这里先设置为false,逻辑上后面再完善
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @Author: fm453
|
||||
* @Date: 2021-09-08 00:25:51
|
||||
* # @Last modified by: fm453
|
||||
* # @Last modified time: 2022-02-08T09:46:43+08:00
|
||||
* @Email: fm453@lukegzs.com
|
||||
*/
|
||||
|
||||
namespace backend\components;
|
||||
|
||||
use Yii;
|
||||
use common\models\CLog;
|
||||
use common\models\User;
|
||||
use common\models\Member;
|
||||
use common\models\Fans;
|
||||
use common\models\CAttachment;
|
||||
use common\models\CSms;
|
||||
use common\models\CVcode;
|
||||
|
||||
use addons\models\AcCar;
|
||||
use addons\models\AcCarOwner;
|
||||
use addons\models\AcCarBrand;
|
||||
use addons\models\AcCarSeries;
|
||||
use addons\models\AcStore;
|
||||
use addons\models\AcEmployee;
|
||||
use addons\models\AcOrder;
|
||||
use addons\models\AcOrderPre;
|
||||
use addons\models\AcOrderStatus;
|
||||
use addons\models\AcTruck;
|
||||
use addons\models\AcDriver;
|
||||
use addons\models\AcPlat;
|
||||
use addons\models\AcContact;
|
||||
|
||||
class Helper
|
||||
{
|
||||
|
||||
//历史访客数
|
||||
public static function getHistoryVisNum()
|
||||
{
|
||||
$res = CLog::find()->count();
|
||||
return $res;
|
||||
}
|
||||
|
||||
//最近一个月访问量
|
||||
public static function getMonthHistoryVisNum()
|
||||
{
|
||||
$LastMonth = strtotime("-1 month");
|
||||
$res = CLog::find()->where(['>', 'create_time', $LastMonth])->count();
|
||||
return $res;
|
||||
}
|
||||
|
||||
//API接口站用户总数
|
||||
public static function getApierCount()
|
||||
{
|
||||
$res = User::find()->count();
|
||||
return $res;
|
||||
}
|
||||
|
||||
//会员数据总数
|
||||
public static function getMemberCount()
|
||||
{
|
||||
$res = Member::find()->count();
|
||||
return $res;
|
||||
}
|
||||
|
||||
//粉丝数据总数
|
||||
public static function getFansCount()
|
||||
{
|
||||
$res = Fans::find()->count();
|
||||
return $res;
|
||||
}
|
||||
|
||||
//短信统计
|
||||
public static function getSmsStat()
|
||||
{
|
||||
$sms = CSms::find()->count();
|
||||
$mobile = CSms::find()->groupBy('mobile')->count();
|
||||
return ['sms' => $sms, 'mobile' => $mobile];
|
||||
}
|
||||
|
||||
//附件统计
|
||||
public static function getAttachStat()
|
||||
{
|
||||
$num = CAttachment::find()->count();
|
||||
$size = CAttachment::find()->sum('filesize');
|
||||
return ['num' => $num, 'size' => $size];
|
||||
}
|
||||
|
||||
//今日运单
|
||||
public static function getOrderToday()
|
||||
{
|
||||
$num = CAttachment::find()->count();
|
||||
$size = CAttachment::find()->sum('filesize');
|
||||
return ['num' => $num, 'size' => $size];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user