//优质二手房
$houseSellBest = $houseSell->getList(array('rowFrom'=>0,'rowTo'=>9),'*',1,' and status =1 and is_index=1' ,' order by order_weight desc');
foreach ($houseSellBest as $key =>$item ){
$houseSellBest[$key]['house_title'] = substrs($item['house_title'],20);
$houseSellBest[$key]['cityarea_name'] = substr($cityarea_option[$item['cityarea_id']],0,6);
$houseSellBest[$key]['borough_name'] = substrs($item['borough_name'],12);
能不做解释下没一句的大致作用啊??
我想写一个
//经纪人发布的优质二手房 
*
*
*
*应该怎么写呢???

解决方案 »

  1.   

    $houseSellBest = $houseSell->getList(array('rowFrom'=>0,'rowTo'=>9),'*',1,' and status =1 and is_index=1' ,' order by order_weight desc');
    foreach ($houseSellBest as $key =>$item ){
    $houseSellBest[$key]['house_title'] = substrs($item['house_title'],20);
    $houseSellBest[$key]['cityarea_name'] = substr($cityarea_option[$item['cityarea_id']],0,6);
    $houseSellBest[$key]['borough_name'] = substrs($item['borough_name'],12);
    中getList是$houseSell类的方法名称;
    array('rowFrom'=>0,'rowTo'=>9)参数是用于分页;
    ‘*’是读取表中的所有字段;
    and status =1 and is_index=1是sql语句中的where条件;
    ' order by order_weight desc'用于sql语句中的排序;
      

  2.   

    至于
    foreach ($houseSellBest as $key =>$item ){
    $houseSellBest[$key]['house_title'] = substrs($item['house_title'],20);
    $houseSellBest[$key]['cityarea_name'] = substr($cityarea_option[$item['cityarea_id']],0,6);
    $houseSellBest[$key]['borough_name'] = substrs($item['borough_name'],12);
    就不用多说了吧,是按数据库的字段去内容的
      

  3.   

    让人写 sql ,总有个 表结构吧。楼主应该加强 sql 。。我在学校也会了。不就是加个 and 条件吗???