| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace app\model\saas;
- use app\extra\basic\Model;
- /**
- * @property integer $id (主键)
- * @property integer $goods_id 来客商品ID
- * @property mixed $sku_id
- * @property mixed $product_id 本地商品ID
- * @property string $name
- * @property string $image
- * @property integer $line_price
- * @property integer $price
- * @property mixed $specs
- * @property integer $is_default
- * @property mixed $create_at
- */
- class SaasGoodsSku 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_sku";
-
- /**
- * 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 setLinePriceAttr($value): int
- {
- return $value * 100;
- }
- public function getLinePriceAttr($value): float
- {
- return $value / 100;
- }
- }
|