Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Post.link' in 'where clause'
SQL Query: SELECT `Post`.`id`, `Post`.`name`, `Post`.`code`, `Post`.`alias`, `Post`.`cat_id`, `Post`.`price`, `Post`.`type`, `Post`.`shortdes`, `Post`.`content`, `Post`.`images`, `Post`.`images_multi`, `Post`.`pos`, `Post`.`new`, `Post`.`hot`, `Post`.`saleoff`, `Post`.`title_seo`, `Post`.`meta_key`, `Post`.`meta_des`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`view`, `Post`.`slug`, `Post`.`name_eng`, `Post`.`shortdes_eng`, `Post`.`content_eng`, `Post`.`phut`, `Post`.`shortdes_tq`, `Post`.`content_tq`, `Post`.`name_tq`, `Post`.`nguoilon`, `Post`.`treem`, `Post`.`truso`, `Post`.`don`, `Post`.`doi`, `Post`.`lon`, `Post`.`tour`, `Post`.`tourtrongnuoc`, `Post`.`tournuocngoai`, `Post`.`noiden`, `Post`.`ngaydi`, `Post`.`thangdi`, `Post`.`namdi`, `Post`.`ngaykhoihanh`, `Post`.`thoigiandi`, `Post`.`ngaykhoihanh_eng`, `Post`.`thoigiandi_eng`, `Post`.`videoyou`, `Post`.`nt`, `Post`.`duration`, `Post`.`duration_eng`, `Post`.`twodaypro`, `Post`.`twodaypro_eng`, `Post`.`threedaypro`, `Post`.`threedaypro_eng`, `Post`.`photo`, `Post`.`lft`, `Post`.`rght`, `Post`.`vat`, `Post`.`hangsx`, `Post`.`baohanh`, `Post`.`tinhtrang`, `Post`.`tailieu`, `Post`.`tag`, `Catproduct`.`id`, `Catproduct`.`name`, `Catproduct`.`parent_id`, `Catproduct`.`alias`, `Catproduct`.`images`, `Catproduct`.`lft`, `Catproduct`.`rght`, `Catproduct`.`pos`, `Catproduct`.`status`, `Catproduct`.`title_seo`, `Catproduct`.`meta_key`, `Catproduct`.`meta_des`, `Catproduct`.`created`, `Catproduct`.`modified`, `Catproduct`.`slug`, `Catproduct`.`cate`, `Catproduct`.`link`, `Catproduct`.`name_eng`, `Catproduct`.`name_tq`, `Catproduct`.`type`, `Catproduct`.`hot`, `Catproduct`.`content`, `Catproduct`.`display`, `Catproduct`.`content_eng`, `Catproduct`.`danght`, `Catproduct`.`url` FROM `bigway_db`.`posts` AS `Post` LEFT JOIN `bigway_db`.`catproducts` AS `Catproduct` ON (`Post`.`cat_id` = `Catproduct`.`id`) WHERE `Post`.`link` = 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' LIMIT 1
Notice: If you want to customize this error message, create app/View/Errors/pdo_error.ctp
try {
$query = $this->_connection->prepare($sql, $prepareOptions);
$query->setFetchMode(PDO::FETCH_LAZY);
if (!$query->execute($params)) {
$this->_results = $query;
array()
$options += array('log' => $this->fullDebug);
$t = microtime(true);
$this->_result = $this->_execute($sql, $params);
'SELECT `Post`.`id`, `Post`.`name`, `Post`.`code`, `Post`.`alias`, `Post`.`cat_id`, `Post`.`price`, `Post`.`type`, `Post`.`shortdes`, `Post`.`content`, `Post`.`images`, `Post`.`images_multi`, `Post`.`pos`, `Post`.`new`, `Post`.`hot`, `Post`.`saleoff`, `Post`.`title_seo`, `Post`.`meta_key`, `Post`.`meta_des`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`view`, `Post`.`slug`, `Post`.`name_eng`, `Post`.`shortdes_eng`, `Post`.`content_eng`, `Post`.`phut`, `Post`.`shortdes_tq`, `Post`.`content_tq`, `Post`.`name_tq`, `Post`.`nguoilon`, `Post`.`treem`, `Post`.`truso`, `Post`.`don`, `Post`.`doi`, `Post`.`lon`, `Post`.`tour`, `Post`.`tourtrongnuoc`, `Post`.`tournuocngoai`, `Post`.`noiden`, `Post`.`ngaydi`, `Post`.`thangdi`, `Post`.`namdi`, `Post`.`ngaykhoihanh`, `Post`.`thoigiandi`, `Post`.`ngaykhoihanh_eng`, `Post`.`thoigiandi_eng`, `Post`.`videoyou`, `Post`.`nt`, `Post`.`duration`, `Post`.`duration_eng`, `Post`.`twodaypro`, `Post`.`twodaypro_eng`, `Post`.`threedaypro`, `Post`.`threedaypro_eng`, `Post`.`photo`, `Post`.`lft`, `Post`.`rght`, `Post`.`vat`, `Post`.`hangsx`, `Post`.`baohanh`, `Post`.`tinhtrang`, `Post`.`tailieu`, `Post`.`tag`, `Catproduct`.`id`, `Catproduct`.`name`, `Catproduct`.`parent_id`, `Catproduct`.`alias`, `Catproduct`.`images`, `Catproduct`.`lft`, `Catproduct`.`rght`, `Catproduct`.`pos`, `Catproduct`.`status`, `Catproduct`.`title_seo`, `Catproduct`.`meta_key`, `Catproduct`.`meta_des`, `Catproduct`.`created`, `Catproduct`.`modified`, `Catproduct`.`slug`, `Catproduct`.`cate`, `Catproduct`.`link`, `Catproduct`.`name_eng`, `Catproduct`.`name_tq`, `Catproduct`.`type`, `Catproduct`.`hot`, `Catproduct`.`content`, `Catproduct`.`display`, `Catproduct`.`content_eng`, `Catproduct`.`danght`, `Catproduct`.`url` FROM `bigway_db`.`posts` AS `Post` LEFT JOIN `bigway_db`.`catproducts` AS `Catproduct` ON (`Post`.`cat_id` = `Catproduct`.`id`) WHERE `Post`.`link` = 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' LIMIT 1' array()
if ($cache && ($cached = $this->getQueryCache($sql, $params)) !== false) {
return $cached;
}
if ($result = $this->execute($sql, array(), $params)) {
$out = array();
'SELECT `Post`.`id`, `Post`.`name`, `Post`.`code`, `Post`.`alias`, `Post`.`cat_id`, `Post`.`price`, `Post`.`type`, `Post`.`shortdes`, `Post`.`content`, `Post`.`images`, `Post`.`images_multi`, `Post`.`pos`, `Post`.`new`, `Post`.`hot`, `Post`.`saleoff`, `Post`.`title_seo`, `Post`.`meta_key`, `Post`.`meta_des`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`view`, `Post`.`slug`, `Post`.`name_eng`, `Post`.`shortdes_eng`, `Post`.`content_eng`, `Post`.`phut`, `Post`.`shortdes_tq`, `Post`.`content_tq`, `Post`.`name_tq`, `Post`.`nguoilon`, `Post`.`treem`, `Post`.`truso`, `Post`.`don`, `Post`.`doi`, `Post`.`lon`, `Post`.`tour`, `Post`.`tourtrongnuoc`, `Post`.`tournuocngoai`, `Post`.`noiden`, `Post`.`ngaydi`, `Post`.`thangdi`, `Post`.`namdi`, `Post`.`ngaykhoihanh`, `Post`.`thoigiandi`, `Post`.`ngaykhoihanh_eng`, `Post`.`thoigiandi_eng`, `Post`.`videoyou`, `Post`.`nt`, `Post`.`duration`, `Post`.`duration_eng`, `Post`.`twodaypro`, `Post`.`twodaypro_eng`, `Post`.`threedaypro`, `Post`.`threedaypro_eng`, `Post`.`photo`, `Post`.`lft`, `Post`.`rght`, `Post`.`vat`, `Post`.`hangsx`, `Post`.`baohanh`, `Post`.`tinhtrang`, `Post`.`tailieu`, `Post`.`tag`, `Catproduct`.`id`, `Catproduct`.`name`, `Catproduct`.`parent_id`, `Catproduct`.`alias`, `Catproduct`.`images`, `Catproduct`.`lft`, `Catproduct`.`rght`, `Catproduct`.`pos`, `Catproduct`.`status`, `Catproduct`.`title_seo`, `Catproduct`.`meta_key`, `Catproduct`.`meta_des`, `Catproduct`.`created`, `Catproduct`.`modified`, `Catproduct`.`slug`, `Catproduct`.`cate`, `Catproduct`.`link`, `Catproduct`.`name_eng`, `Catproduct`.`name_tq`, `Catproduct`.`type`, `Catproduct`.`hot`, `Catproduct`.`content`, `Catproduct`.`display`, `Catproduct`.`content_eng`, `Catproduct`.`danght`, `Catproduct`.`url` FROM `bigway_db`.`posts` AS `Post` LEFT JOIN `bigway_db`.`catproducts` AS `Catproduct` ON (`Post`.`cat_id` = `Catproduct`.`id`) WHERE `Post`.`link` = 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' LIMIT 1' array() array()
$query = trim($this->generateAssociationQuery($model, null, null, null, null, $queryData, false, $null));
$resultSet = $this->fetchAll($query, $model->cacheQueries);
'SELECT `Post`.`id`, `Post`.`name`, `Post`.`code`, `Post`.`alias`, `Post`.`cat_id`, `Post`.`price`, `Post`.`type`, `Post`.`shortdes`, `Post`.`content`, `Post`.`images`, `Post`.`images_multi`, `Post`.`pos`, `Post`.`new`, `Post`.`hot`, `Post`.`saleoff`, `Post`.`title_seo`, `Post`.`meta_key`, `Post`.`meta_des`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`view`, `Post`.`slug`, `Post`.`name_eng`, `Post`.`shortdes_eng`, `Post`.`content_eng`, `Post`.`phut`, `Post`.`shortdes_tq`, `Post`.`content_tq`, `Post`.`name_tq`, `Post`.`nguoilon`, `Post`.`treem`, `Post`.`truso`, `Post`.`don`, `Post`.`doi`, `Post`.`lon`, `Post`.`tour`, `Post`.`tourtrongnuoc`, `Post`.`tournuocngoai`, `Post`.`noiden`, `Post`.`ngaydi`, `Post`.`thangdi`, `Post`.`namdi`, `Post`.`ngaykhoihanh`, `Post`.`thoigiandi`, `Post`.`ngaykhoihanh_eng`, `Post`.`thoigiandi_eng`, `Post`.`videoyou`, `Post`.`nt`, `Post`.`duration`, `Post`.`duration_eng`, `Post`.`twodaypro`, `Post`.`twodaypro_eng`, `Post`.`threedaypro`, `Post`.`threedaypro_eng`, `Post`.`photo`, `Post`.`lft`, `Post`.`rght`, `Post`.`vat`, `Post`.`hangsx`, `Post`.`baohanh`, `Post`.`tinhtrang`, `Post`.`tailieu`, `Post`.`tag`, `Catproduct`.`id`, `Catproduct`.`name`, `Catproduct`.`parent_id`, `Catproduct`.`alias`, `Catproduct`.`images`, `Catproduct`.`lft`, `Catproduct`.`rght`, `Catproduct`.`pos`, `Catproduct`.`status`, `Catproduct`.`title_seo`, `Catproduct`.`meta_key`, `Catproduct`.`meta_des`, `Catproduct`.`created`, `Catproduct`.`modified`, `Catproduct`.`slug`, `Catproduct`.`cate`, `Catproduct`.`link`, `Catproduct`.`name_eng`, `Catproduct`.`name_tq`, `Catproduct`.`type`, `Catproduct`.`hot`, `Catproduct`.`content`, `Catproduct`.`display`, `Catproduct`.`content_eng`, `Catproduct`.`danght`, `Catproduct`.`url` FROM `bigway_db`.`posts` AS `Post` LEFT JOIN `bigway_db`.`catproducts` AS `Catproduct` ON (`Post`.`cat_id` = `Catproduct`.`id`) WHERE `Post`.`link` = 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' LIMIT 1' false
return null;
}
$results = $this->getDataSource()->read($this, $query);
$this->resetAssociations();
object(Post) { name => 'Post' displayField => 'name' belongsTo => array( [maximum depth reached] ) useDbConfig => 'default' useTable => 'posts' id => false data => array([maximum depth reached]) schemaName => 'bigway_db' table => 'posts' primaryKey => 'id' validate => array([maximum depth reached]) validationErrors => array([maximum depth reached]) validationDomain => null alias => 'Post' tableToModel => array( [maximum depth reached] ) cacheQueries => false hasOne => array([maximum depth reached]) hasMany => array([maximum depth reached]) hasAndBelongsToMany => array([maximum depth reached]) actsAs => null Behaviors => object(BehaviorCollection) {} whitelist => array([maximum depth reached]) cacheSources => true findQueryType => null recursive => (int) 1 order => null virtualFields => array([maximum depth reached]) __backAssociation => array([maximum depth reached]) __backInnerAssociation => array([maximum depth reached]) __backOriginalAssociation => array([maximum depth reached]) __backContainableAssociation => array([maximum depth reached]) findMethods => array( [maximum depth reached] ) tablePrefix => '' Catproduct => object(Catproduct) {} } array( 'conditions' => array( 'Post.link' => 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' ), 'fields' => null, 'joins' => array(), 'limit' => (int) 1, 'offset' => null, 'order' => array( (int) 0 => null ), 'page' => (int) 1, 'group' => null, 'callbacks' => true, 'recursive' => null )
if (isset($params[3 + $off])) {
$recursive = $params[3 + $off];
}
return $args[2]->find('first', compact('conditions', 'fields', 'order', 'recursive'));
}
'first' array( 'conditions' => array( 'Post.link' => 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' ), 'fields' => null, 'order' => null, 'recursive' => null )
if ($result !== array('unhandled')) {
return $result;
}
$return = $this->getDataSource()->query($method, $params, $this);
return $return;
'findByLink' array( (int) 0 => 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' ) object(Post) { name => 'Post' displayField => 'name' belongsTo => array( [maximum depth reached] ) useDbConfig => 'default' useTable => 'posts' id => false data => array([maximum depth reached]) schemaName => 'bigway_db' table => 'posts' primaryKey => 'id' validate => array([maximum depth reached]) validationErrors => array([maximum depth reached]) validationDomain => null alias => 'Post' tableToModel => array( [maximum depth reached] ) cacheQueries => false hasOne => array([maximum depth reached]) hasMany => array([maximum depth reached]) hasAndBelongsToMany => array([maximum depth reached]) actsAs => null Behaviors => object(BehaviorCollection) {} whitelist => array([maximum depth reached]) cacheSources => true findQueryType => null recursive => (int) 1 order => null virtualFields => array([maximum depth reached]) __backAssociation => array([maximum depth reached]) __backInnerAssociation => array([maximum depth reached]) __backOriginalAssociation => array([maximum depth reached]) __backContainableAssociation => array([maximum depth reached]) findMethods => array( [maximum depth reached] ) tablePrefix => '' Catproduct => object(Catproduct) {} }
public function chitiet($id = null) {
$detailNews = $this->Post->findBySlug($id);
if(!$detailNews) $detailNews = $this->Post->findByLink($id);
if(!$detailNews){
'findByLink' array( (int) 0 => 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' )
public function chitiet($id = null) {
$detailNews = $this->Post->findBySlug($id);
if(!$detailNews) $detailNews = $this->Post->findByLink($id);
if(!$detailNews){
'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05'
'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05'
'action' => $request->params['action']
));
}
return $method->invokeArgs($this, $request->params['pass']);
object(ProductController) { name => 'Product' uses => array( [maximum depth reached] ) helpers => array( [maximum depth reached] ) components => array( [maximum depth reached] ) request => object(CakeRequest) {} response => object(CakeResponse) {} viewPath => 'Product' layoutPath => null viewVars => array( [maximum depth reached] ) view => 'chitiet' layout => 'default' autoRender => true autoLayout => true Components => object(ComponentCollection) {} viewClass => 'View' View => null ext => '.ctp' plugin => null cacheAction => false passedArgs => array( [maximum depth reached] ) scaffold => false methods => array( [maximum depth reached] ) modelClass => 'Catproduct' modelKey => 'product' validationErrors => null Session => object(SessionComponent) {} Email => object(EmailComponent) {} Catproduct => object(Catproduct) {} Advertisement => object(AppModel) {} Product => object(Product) {} Post => object(Post) {} Slideshow => object(AppModel) {} Setting => object(AppModel) {} } array( (int) 0 => 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05' )
$controller->startupProcess();
$render = true;
$result = $controller->invokeAction($request);
if ($result instanceof CakeResponse) {
object(CakeRequest) { params => array( [maximum depth reached] ) data => array([maximum depth reached]) query => array([maximum depth reached]) url => 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05.htm' base => '' webroot => '/' here => '/khuyen-mai-tung-bung-mung-dai-le-30-04-01-05.htm' }
));
}
$response = $this->_invoke($controller, $request, $response);
if (isset($request->params['return'])) {
object(ProductController) { name => 'Product' uses => array( [maximum depth reached] ) helpers => array( [maximum depth reached] ) components => array( [maximum depth reached] ) request => object(CakeRequest) {} response => object(CakeResponse) {} viewPath => 'Product' layoutPath => null viewVars => array( [maximum depth reached] ) view => 'chitiet' layout => 'default' autoRender => true autoLayout => true Components => object(ComponentCollection) {} viewClass => 'View' View => null ext => '.ctp' plugin => null cacheAction => false passedArgs => array( [maximum depth reached] ) scaffold => false methods => array( [maximum depth reached] ) modelClass => 'Catproduct' modelKey => 'product' validationErrors => null Session => object(SessionComponent) {} Email => object(EmailComponent) {} Catproduct => object(Catproduct) {} Advertisement => object(AppModel) {} Product => object(Product) {} Post => object(Post) {} Slideshow => object(AppModel) {} Setting => object(AppModel) {} } object(CakeRequest) { params => array( [maximum depth reached] ) data => array([maximum depth reached]) query => array([maximum depth reached]) url => 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05.htm' base => '' webroot => '/' here => '/khuyen-mai-tung-bung-mung-dai-le-30-04-01-05.htm' } object(CakeResponse) { }
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
object(CakeRequest) { params => array( [maximum depth reached] ) data => array([maximum depth reached]) query => array([maximum depth reached]) url => 'khuyen-mai-tung-bung-mung-dai-le-30-04-01-05.htm' base => '' webroot => '/' here => '/khuyen-mai-tung-bung-mung-dai-le-30-04-01-05.htm' } object(CakeResponse) { }