Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ($arr_harga_per_kamar as $harga_per_kamar_key => $harga_per_kamar_value) {
- foreach ($harga_per_kamar_value as $key => $value) {
- $type_kamar_detail = HotelDetail::findOne([
- 'id_hotel' => $id,
- 'parent' => $harga_per_kamar_key
- ]);
- if(empty($type_kamar_detail)){
- $type_kamar_detail = new HotelDetail();
- $type_kamar_detail->id = Yii::$app->db->createCommand('select UUID()')->queryScalar();
- $type_kamar_detail->parent = $harga_per_kamar_key;
- }
- $type_kamar_detail->id_hotel = $id;
- $type_kamar_detail->title = $value['title'];
- $type_kamar_detail->price = $value['harga'];
- $type_kamar_detail->jumlah_tamu = $value['jumlah_tamu'];
- $type_kamar_detail->jumlah_bed = $value['jumlah_bed'];
- $type_kamar_detail->id_voucher = $value['id_voucher'];
- $type_kamar_detail->data = new JsonExpression($value['fasilitas']);
- $type_kamar_detail->status = 1;
- $type_kamar_detail->save();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement