fleaphp 关联表 打印出sql 语句不对解决办法

WBOY
Release: 2016-06-13 13:51:05
Original
1044 people have browsed it

fleaphp 关联表 打印出sql 语句不对
FLEA::loadClass('FLEA_Db_TableDataGateway');
class Table_Ipromiseusers extends FLEA_Db_TableDataGateway {

var $tableName = 'ipromise_users';
/**
* 指定主键字段名
*
* @var string
*/
var $primaryKey = 'id';

var $hasMany = array(
'tableClass' => 'Table_Ipromisevote',
'mappingName' => 'id',
'foreignKey' => 'u_id',
);
}
?>
这是用户表关联文章表的配置

控制器里面调用
$obj_temp = FLEA::getSingleton('Table_Ipromiseusers');
$row = array();
if(isset($_GET['u']) || !empty($u)){
$con = 'con';
$u = $_GET['u'];
$conditions = "nums like '%".$u."%'";
$pager = new Model_extPager($obj_temp, $page, 1, $conditions, $sort);
$rows = $pager->findAll();}
rows数组是两个表的数据
二现在前台怎么是一个表的sql:: SELECT `bz_ipromise_users`.`id` AS flea_pkref_id, `bz_ipromise_users`.* FROM `bz_ipromise_users`

没有关联起来,那点出错啦


------解决方案--------------------
很简单。。。。。。。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!