• 同数据库配置文件,复制一个databasenewchat.php

    填写数据库信息
    
  • config导入配置文件,并且导出名称

    $db_newchat=require_once ('databasenewchat.php');
    return [
        'db_newchat'          => $db_newchat,
        'app_namespace'          => 'app',
        // 应用调试模式
        'app_debug'              => Env::get('app.debug', false),
        // 应用Trace
        'app_trace'              => Env::get('app.trace', false),
        ...
    
    
  • 创建模型文件,定义数据库配置文件NewchatUser.php

    // 表名
        protected $connection='db_newchat';
        protected $name = 'user';
    
  • 任意控制器中,引入模型,就可以进行数据库这个删改查

    NewchatUser::where('username|mobile|nickname','=',$params['doctorusername'])->value('username');
    

相关文章:

  • 2021-08-20
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-16
  • 2021-10-21
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
  • 2021-06-03
相关资源
相似解决方案