Home  >  Article  >  Backend Development  >  fleaphp 联系关系表 打印出sql 语句不对

fleaphp 联系关系表 打印出sql 语句不对

WBOY
WBOYOriginal
2016-06-13 12:57:59895browse

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`

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

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

Statement:
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