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' => '包含图片附件'
)
)
);
}
ok 完成。前台调用即可
$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 完成。前台调用即可
相关文章推荐
- 【.Net】C# 将Access中时间段条件查询的数据添加到ListView中
- phpwind 房产 数据来源 添加字段调用
- 条件查询List集合,由查询的结果,算出一行数据,添加到集合中!
- Silverlight 3 关于数据添加,删除,修改,条件查询的一点代码
- C# 将Access中时间段条件查询的数据添加到ListView中
- 百度地图动态添加数据及条件查询
- C#如何将Access中以时间段条件查询的数据添加到ListView中
- 添加查询删除+retrofit请求+okHttp请求+fresco加载图片+recyclerview加载数据二级购物车+视频播放
- MyBatis映射文件(集合数据的添加与获取,条件查询,模糊查询)
- 【黑马Android】(05)短信/查询和添加/内容观察者使用/子线程网络图片查看器和Handler消息处理器/html查看器/使用HttpURLConnection采用Post方式请求数据/开源项目
- python3-操作SQLite、创建表、添加数据、查询数据
- phpexcel中文教程-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
- 为我们的数据添加附件
- 稳扎稳打Silverlight(57) - 4.0通信之WCF RIA Services: 概述, 通过 DomainDataSource 实现数据的添加、查询、更新和删除操作
- 使用函数查询符合条件的表,并清空表数据,或者删除表
- 稳扎稳打Silverlight(57) - 4.0通信之WCF RIA Services: 概述, 通过 DomainDataSource 实现数据的添加、查询、更新和删除操作
- Java操作Hbase进行建表、删表以及对数据进行增删改查,条件查询
- C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据
- 稳扎稳打Silverlight(58) - 4.0通信之WCF RIA Services: 通过 Domain Service, 以 MVVM 模式实现数据的添加、删除、修改和查询
- 如何将从一个表中查询出来的数据一次性的添加到另一个表