*/ class Test extends Model { use BaseModel; protected $schema = [ 'id' => 'int', 'title' => 'varchar', 'cover' => 'varchar', 'show_images' => 'varchar', 'intro' => 'varchar', 'status' => 'tinyint', 'administrators_id' => 'int', 'pid' => 'int', 'content' => 'text', 'create_time' => 'datetime', 'update_time' => 'datetime', 'delete_time' => 'int', ]; /** * 状态返回值处理 * @param bool $tag * @return array */ public static function getStatusSc($tag = true) { return $tag === true ? [ '1' => Layui::tag()->blue('正常'), '2' => Layui::tag()->red('冻结'), ] : [ '1' => '正常', '2' => '冻结', ]; } }