ledc / crmeb-delivery-slot-booking
Crmeb单商户系统-预订配送时间段管理插件。
v7.2.13
2025-05-26 06:48 UTC
Requires
- php: >=7.4
- ext-ctype: *
- ext-json: *
- ext-openssl: *
- ledc/think-model-trait: ^7.2.11
- topthink/framework: >=6.0
README
安装
composer require ledc/crmeb-delivery-slot-booking
使用说明
-
安装完之后,请执行以下命令,安装插件的数据库迁移文件
php think install:migrate:crmeb-delivery-slot-booking
-
执行数据库迁移
php think migrate:run
内置命令
php think test:delivery:schedule
测试配送时间段,打印结果数组
数据表
delivery_time_slots
配送时间段表delivery_schedule_templates
配送时间段模板表delivery_schedule_exceptions
配送时间段异常表
业务逻辑说明
- 使用
delivery_time_slots
定义可以使用的配送时间段 - 使用
delivery_schedule_templates
定义每周每天的配送时间段 - 如果某一天在
delivery_schedule_exceptions
中有定义,则使用delivery_schedule_exceptions
中定义的配送时间段,并通过status
控制当天的配送状态 - 可以在
delivery_schedule_templates
自由组合多个时间段,并通过enabled
控制启用状态,灵活切换配送时间段
助手类
Ledc\DeliverySlotBooking\Helper::get
获取预订配送时间段Ledc\DeliverySlotBooking\Helper::validate
验证时间段是否在允许配送的时间段内
扩展建议
- 若需支持多仓库/区域不同配送时间,可在上述表中添加
region_id
或warehouse_id
字段。 - 若需要限制每个时间段的最大订单数,可在
delivery_time_slots
表中添加max_orders
字段并在业务层控制。