Skip to content

mix-plus/db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

介绍

新建model继承AbstractModel,配置数据表名,主键

<?php

namespace App\Model;

use MixPlus\Framework\Database\AbstractModel;

class UserModel extends AbstractModel
{
    protected string $primaryKey = 'user_id';

    protected string $table = 'kd_farm_account';
}

使用

$user = (new UserModel())->getOneId(414, [
    'user_id', 'nickname'
]);

Releases

No releases published

Packages

No packages published

Languages