Commit e051d79c authored by Dmitriy's avatar Dmitriy

Исправлен запрос для получения пути POST-запроса исправления опечатки

parent fad5b436
...@@ -362,7 +362,7 @@ private function get_site_id($DBH, $url) { ...@@ -362,7 +362,7 @@ private function get_site_id($DBH, $url) {
//require_once("/home/eterfund/www/eterfund.ru/api/typos/dbfunctions.php"); //require_once("/home/eterfund/www/eterfund.ru/api/typos/dbfunctions.php");
$id_site = $this->get_site_id($this->db, $link); $id_site = $this->get_site_id($this->db, $link);
$this->db->select("s.site as site"); $this->db->select("s.site as site, s.path as path");
$this->db->from("sites as s"); $this->db->from("sites as s");
$this->db->where("s.id", $id_site); $this->db->where("s.id", $id_site);
$site = $this->db->get()->row(); $site = $this->db->get()->row();
......
...@@ -135,7 +135,7 @@ class Site extends CI_Model { ...@@ -135,7 +135,7 @@ class Site extends CI_Model {
/*Обновление названия*/ /*Обновление названия*/
function updateSite($data) { function updateSite($data) {
if (!$this->isSiteUnique($data['site'])) { if (!$this->isSiteUnique($data['site'], $data['id_site'])) {
return array('message' => 'Сайт не уникален'); return array('message' => 'Сайт не уникален');
} }
...@@ -167,8 +167,9 @@ class Site extends CI_Model { ...@@ -167,8 +167,9 @@ class Site extends CI_Model {
} }
/*Проверяем сайт на уникальность*/ /*Проверяем сайт на уникальность*/
function isSiteUnique($site) { function isSiteUnique($site, $id = '') {
$this->db->where("site", $site); $this->db->where("site", $site);
$this->db->where('id !=', $id);
$this->db->from("sites"); $this->db->from("sites");
$count = $this->db->count_all_results(); $count = $this->db->count_all_results();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment