| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- declare (strict_types=1);
- namespace App\Model\Mongo;
- use Hyperf\Mongodb\Mongodb;
- use Hyperf\Utils\ApplicationContext;
- use MongoDB\Client;
- /**
- * Class UserRelationModel
- * @return Client|UserRelationModel
- *
- * @package App\Model\Mongo
- */
- class HotelLogModel extends Mongodb
- {
- protected $collectionName = 'hotel_log'; // mongoDB 表名
- protected $poolName = 'kaifang';
- public function db()
- {
- $container = ApplicationContext::getContainer();
- /**
- * @var $mongodb Client
- */
- $mongodb = $container->get(self::class);
- return $mongodb->selectDatabase(env('MONGODB_KAIFANG_DB'))
- ->selectCollection($this->collectionName);
- }
- }
|