docRef.get().then((doc) => {
if (doc.exists) {
result = 'Такой номер уже есть';
console.log('Такой номер уже есть');
}else{
db.collection('users').doc(user.phone).set(user);
result = true;
console.log(true);
}
}).catch((error) => {
result = 'Произошла ошибка';
console.log('Произошла ошибка');
});
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
<?
DB::enableQueryLog();
// some code ...
DB::getQueryLog();
?>
$('#form').validator().on('submit', function (e) {
if (e.isDefaultPrevented()) {
// handle the invalid form...
} else {
// everything looks good!
}
})
<? if (!CModule::IncludeModule('highloadblock')) continue;
$ID = 2;
$hldata = Bitrix\Highloadblock\HighloadBlockTable::getById($ID)->fetch();
$hlentity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hldata);
$hlDataClass = $hldata['NAME'].'Table';
$arResult['CUSTOM'] = [];
$arFilter = Array(
Array(
"LOGIC"=>"AND",
Array(
'UF_XML_ID'=> $arItem['PROPERTIES']['YEAR']['VALUE']
)
)
);
$result = $hlDataClass::getList(array(
'select' => array('ID', 'UF_NAME', 'UF_XML_ID'),
'order' => array('UF_XML_ID' =>'ASC'),
'filter' => $arFilter,
));
$arReturn = [];
while ($res = $result->fetch()) {
$arReturn[] = $res;
}
?>