first commit
This commit is contained in:
20
application/common/model/ArticleModel.php
Normal file
20
application/common/model/ArticleModel.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// +------------------------------------------------+
|
||||
// |http://www.cjango.com |
|
||||
// +------------------------------------------------+
|
||||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||||
// +------------------------------------------------+
|
||||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||||
// +------------------------------------------------+
|
||||
namespace app\common\model;
|
||||
|
||||
class ArticleModel extends _Init
|
||||
{
|
||||
protected static function init()
|
||||
{
|
||||
self::beforeInsert(function ($data) {
|
||||
$data->status = 1;
|
||||
$data->sort = $data['sort'] ?: 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user