定制 lisi4ok/yii2-auditlog 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lisi4ok/yii2-auditlog

Composer 安装命令:

composer require lisi4ok/yii2-auditlog

包简介

Yii2 Audit Log. This extension log all models actions -> find/insert/update/delete.

README 文档

README

Yii2 Audit Log. This extension log all models actions -> find/insert/update/delete.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist lisi4ok/yii2-auditlog "*"

or add

"lisi4ok/yii2-auditlog": "*"

to the require section of your composer.json file.

Go to yii app folder. and type:

./yii migrate --migrationPath=@vendor/lisi4ok/yii2-auditlog/migrations

Usage

<?php
namespace app\models;
use Yii;
use lisi4ok\auditlog\behaviors\LoggableBehavior;

class MyModel extends \yii\db\ActiveRecord
{
	public function behaviors() {
		return [
			[
				'class' => LoggableBehavior::className(),
				'ignoredAttributes' => ['created_at', 'updated_at', 'created_by', 'updated_by'], // default []
				'ignorePrimaryKey' => true, // default false
				'ignorePrimaryKeyForActions' => ['insert', 'update'], //default [] Note: (if ignorePrimaryKey set to true, ignorePrimaryKeyForActions is empty will apply for all)
				'dateTimeFormat' => 'Y-m-d H:i:s', // default 'Y-m-d H:i:s'
			],
		];
	}
}

统计信息

  • 总下载量: 5.29k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-09