| 12345678910111213141516171819202122232425 |
- <?php
- namespace App\Model\Mongo;
- use Hyperf\Mongodb\Mongodb;
- use Hyperf\Utils\ApplicationContext;
- use MongoDB\Client;
- class UserLoginLogModel extends Mongodb
- {
- // mongoDB 表名
- protected $collectionName = 'user_login_log'; // mongoDB 表名
- public function db()
- {
- $container = ApplicationContext::getContainer();
- /**
- * @var $mongodb Client
- */
- $mongodb = $container->get(self::class);
- return $mongodb->selectDatabase(env('MONGODB_DB'))
- ->selectCollection($this->collectionName);
- }
- }
|