luck-draw/app/model/Model.php

18 lines
330 B
PHP
Raw Normal View History

2022-02-22 09:27:27 +00:00
<?php
namespace app\model;
class Model extends Base
{
//获取模型列表
public static function getList()
{
return self::order('sort asc')
->select()
->toArray();
}
public static function onAfterInsert($model)
{
$model->sort = $model->id;
$model->save();
}
}