102 lines
2.1 KiB
PHP
Executable File
102 lines
2.1 KiB
PHP
Executable File
<?php
|
|
|
|
|
|
/*require_once 'set/' . $_SERVER['SERVER_NAME'] . '.php';
|
|
require_once('/www/core/api/php/pd.php');
|
|
\DBmysql::$dsn = 'mysql:dbname=mainbd;host=localhost';
|
|
\DBmysql::$user = 'admin';
|
|
\DBmysql::$pass = '32143214';
|
|
*/
|
|
//print_r($res);
|
|
|
|
|
|
//Берем оригинальный номер
|
|
|
|
//$or_id=\DBmysql::getValue("SELECT `id` FROM `tovar_category` WHERE `originalid`=? LIMIT 1", $res['tovar']['category']);
|
|
//echo $or_id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*if (file_exists('cache/tavrnt.ru_' . $_GET['id'] . '.html')){
|
|
$smarty->assign('includeHarsFile', 1);
|
|
}*/
|
|
|
|
|
|
|
|
|
|
//Конверт
|
|
/*
|
|
{"
|
|
tovar_id_1c":null,
|
|
"keywords":null,
|
|
"description":null,
|
|
"tovar_cat_1c":null,
|
|
"countImg":3,
|
|
"brand_id":1305,
|
|
"check_img":null,
|
|
"linkimg":null,
|
|
"donor":null,
|
|
"cena_d":1707442418,
|
|
"multicat":null,
|
|
"sort":10,
|
|
"partner":"samson",
|
|
"brand":"ГАММА",
|
|
"barcode":"",
|
|
"barcode_id":null}
|
|
*/
|
|
/*
|
|
$massiv=\DB::getAll("SELECT * FROM `tovar` WHERE `site`=?", 'tavrnt.ru');
|
|
//print_r($massiv);
|
|
$c=count($massiv);
|
|
|
|
for ($i=0; $i<$c; $i++){
|
|
|
|
$title=$massiv[$i]['title'];
|
|
$txt=$massiv[$i]['txt'];
|
|
$site='tavrnt.ru';
|
|
$artikul=$massiv[$i]['artikul'];
|
|
$cena=$massiv[$i]['cena'];
|
|
$code=$massiv[$i]['code'];
|
|
$status=$massiv[$i]['status'];
|
|
|
|
$m['keywords']=$massiv[$i]['keywords'];
|
|
$m['description']=$massiv[$i]['description'];
|
|
$m['donor']=$massiv[$i]['donor'];
|
|
$m['partner']=$massiv[$i]['partner'];
|
|
$m['original_id']=$massiv[$i]['id'];
|
|
|
|
$json=\core::j($m);
|
|
|
|
$category=\DBmysql::getValue("SELECT `id` FROM `tovar_category` WHERE `originalid`=? LIMIT 1", $massiv[$i]['category']);
|
|
|
|
$img=\DB::getAll("SELECT `filename`, `tip` FROM `img` WHERE `content_type`=? AND `content_id`=?",['tovar', $massiv[$i]['category']]);
|
|
|
|
|
|
$jsonimg=\core::j($img);
|
|
|
|
|
|
//\DBmysql::add("INSERT INTO `tovar`(`title`, `txt`, `site`, `artikul`, `cena`, `code`, `status`, `json`, `images`, `category`)VALUES(?,?,?, ?,?,?, ?,?,?, ?)",[
|
|
// $title, $txt, $site, $artikul, $cena, $code, $status, $json, $jsonimg, $category
|
|
//]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//$massiv=\DBmysql::getAll("SELECT * FROM `users`");
|
|
|
|
*/
|
|
?>
|