您的位置:首页 > 编程语言 > PHP开发

phpwind 二手房数据来源 添加 有无图片附件条件查询

2012-06-12 17:29 417 查看
house/lib/db/house_secondsaledb.class.php

$this->_expandFields = array('equal'=>array('istop','isurgent','username','isbroker'),'in'=>array('uid','state'),'like'=>array('thumb')); //后台扩展的字段

添加 图片附件 thumb like 判断

house/lib/source/salesource.class.php

修改对应方法

/**
* 选择项
* @return array
*/
function getSourceConfig() {
return array(
'tag' =>array(
'name'=>'房源标签',
'type'=>'select',
'value'=> array(
'all'=>'不限',
'top' => '置顶',
'urgent' => '加急'
)
),
'sortorder' => array(
'name' => '排序方式',
'type' => 'select',
'value' => $this->_getSortList()
),
'type' => array(
'name' => '发布来源',
'type' => 'select',
'value' => array(
'all' => '不限',
'broker' => '经纪人发布',
'personal' => '个人发布'

)
),
'includethumb' => array(
'name' => '图片附件',
'type' => 'select',
'value' => array(
'all' => '不限',
'salepic' => '包含图片附件'

)
)
);
}

/**
* 处理传入的数据
* @param array $config
* @return array $temp
*/
function _initConfig($config) {
$temp = array();
list($temp['sortfield'], $temp['sorttype']) = explode(',', $config['sortorder']);
($config['tag'] == 'all') || ($temp['expand'] = $config['tag'] == 'top' ? array('istop' => 1) : array('isurgent' => 1));
($config['type'] == 'all') || ($temp['expand']['isbroker'] = $config['type'] == 'personal' ? 0 : 1);
($config['includethumb'] == 'all') || ($temp['expand']['thumb'] = $config['includethumb'] == 'salepic' ? 'salepic' : '');
return $temp;
}


ok 完成。前台调用即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  list 扩展
相关文章推荐