| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- declare(strict_types=1);
- namespace SixShop\LimitPurchase\Model;
- use think\Model;
- use think\model\concern\SoftDelete;
- use think\model\relation\BelongsTo;
- /**
- * 商品限购规则关联模型
- *
- * @property int $id 主键
- * @property int $goods_id 商品ID
- * @property int $rule_id 限购规则ID
- */
- class GoodsLimitPurchaseRuleModel extends Model
- {
- /**
- * 获取模型选项
- *
- * @return array
- */
- protected function getOptions(): array
- {
- return [
- 'name' => 'goods_limit_purchase_rule',
- ];
- }
- public function rule():BelongsTo
- {
- return $this->belongsTo(LimitPurchaseRuleModel::class, 'rule_id', 'id');
- }
- }
|