| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- namespace app\model\saas;
- use app\extra\basic\Model;
- use think\model\relation\HasMany;
- /**
- * @property integer $id (主键)
- * @property mixed $product_id 本地商品ID
- * @property mixed $goods_id 来客商品ID
- * @property mixed $store_id 来客id
- * @property mixed $poi_id
- * @property string $product_name
- * @property mixed $image_list 商品头图
- * @property mixed $category 商品ID组
- * @property mixed $category_id
- * @property integer $settle_type 收款方式
- * @property integer $show_channel 投放渠道
- * @property integer $limit_use_rule 库存类型
- * @property integer $auto_renew 自动延期
- * @property integer $use_date_type 顾客可消费日期类型
- * @property integer $day_duration 指定天数
- * @property integer $can_no_use_date 顾客不可消费日期类型
- * @property integer $code_source_type 券码类型
- * @property integer $limit_rule_type 限购规则
- * @property integer $limit_rule 限购数量
- * @property integer $booking_date 预约时间
- * @property integer $booking_type 预约规则
- * @property integer $booking_unit 预约单位
- * @property integer $rec_person_type 使用张数限制
- * @property integer $rec_person_num_max 限制数量
- * @property integer $mult_sku 多SKU开关
- * @property integer $product_type 商品类型
- * @property string $sold_start_time 售卖日期
- * @property string $sold_end_time 售卖日期
- * @property integer $line_price 划线价
- * @property integer $price 销售价
- * @property mixed $detail_image_list 辅助图
- * @property mixed $environment_image_list 环境图
- * @property mixed $specs 商品搭配
- * @property integer $status 状态
- * @property mixed $create_at
- */
- class SaasGoods extends Model
- {
- /**
- * The connection name for the model.
- *
- * @var string|null
- */
- protected $connection = 'mysql';
-
- /**
- * The table associated with the model.
- *
- * @var string
- */
- protected string $table = "saas_goods";
-
- /**
- * The primary key associated with the table.
- *
- * @var string
- */
- protected string $primaryKey = "id";
-
- /**
- * Indicates if the model should be timestamped.
- *
- * @var bool
- */
- public bool $timestamps = false;
- public function setPriceAttr($value): int
- {
- return $value * 100;
- }
- public function getPriceAttr($value): float
- {
- return $value / 100;
- }
- public function getLinePriceAttr($value): float
- {
- return $value / 100;
- }
- public function skuSpecs(): HasMany
- {
- return $this->hasMany(SaasGoodsSku::class, 'product_id', 'product_id');
- }
- }
|