Initial commit,修正
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
<?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
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* User: lzkong1029
|
||||
* Date: 2016-7-6
|
||||
* Time: 15:10
|
||||
* Description:静态公共函数类库
|
||||
*/
|
||||
|
||||
namespace backend\components;
|
||||
use backend\models\Log;
|
||||
use Yii;
|
||||
|
||||
class Helper {
|
||||
|
||||
public static function hello(){
|
||||
echo 'hello';
|
||||
}
|
||||
|
||||
//历史访客数
|
||||
public static function getHistoryVisNum(){
|
||||
$res = Log::find()->count();
|
||||
return $res;
|
||||
}
|
||||
|
||||
//最近一个月访问量
|
||||
public static function getMonthHistoryVisNum(){
|
||||
$LastMonth = strtotime("-1 month");
|
||||
$res = Log::find()->where(['>','create_time',$LastMonth])->count();
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user