| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Module\Mex\Repositories;
- use App\Module\Mex\Models\MexOrder;
- use UCore\DcatAdmin\Repository\EloquentRepository;
- /**
- * 农贸市场订单仓库
- *
- * 提供农贸市场订单数据的访问和操作功能。
- * 该类是订单模块与后台管理系统的桥梁,用于处理订单数据的CRUD操作。
- */
- class MexOrderRepository extends EloquentRepository
- {
- /**
- * 关联的模型类
- *
- * @var string
- */
- protected $eloquentClass = MexOrder::class;
- /**
- * 构造函数,支持预加载关联关系
- *
- * @param array $with 预加载的关联关系
- */
- public function __construct(array $with = [])
- {
- // 默认预加载商品信息
- $defaultWith = ['item'];
- $relations = array_merge($defaultWith, $with);
- parent::__construct($relations);
- }
- }
|