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