// +---------------------------------------------------------------------- namespace app\common\model\store\product; use app\common\model\BaseModel; class ProductReservation extends BaseModel { public static function tablePk(): string { return 'product_reservation_id'; } public static function tableName(): string { return 'store_product_reservation'; } public function getTimePeriodAttr($value) { return $value ? json_decode($value, true) : []; } public function getSaleTimeWeekAttr($value) { return $value ? json_decode($value, true) : []; } public function searchProductIdAttr($query, $value) { $query->where('product_id', $value); } }