xihrni/yii2-behavior-time 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

xihrni/yii2-behavior-time

Composer 安装命令:

composer require xihrni/yii2-behavior-time

包简介

For automatic updating of database table creation, update, and delete fields in the model.

README 文档

README

Introduction

用于自动更新模型中数据库表的创建、更新和删除字段

Install

$ composer require xihrni/yii2-behavior-time

Demo

CREATE TABLE `xi_article` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
<?php

namespace app\models;

use xihrni\yii2\behaviors\TimeBehavior;

class Article extends \yii\db\ActiveRecord
{
    public static function tableName()
    {
        return '{{%article}}';
    }

    public function behaviors()
    {
        return array_merge(parent::behaviors(), [
            'time' => [
                'class' => TimeBehavior::className(),
            ],
        ]);
    }
}

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-05-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固