|
@@ -243,16 +243,28 @@ class Api
|
|
|
*
|
|
|
* @return mixed
|
|
|
*/
|
|
|
- public function search($ids)
|
|
|
+ public function getSearch($ids, $cate = true)
|
|
|
{
|
|
|
- $data = Dever::db('attr/info')->($where);
|
|
|
+ if ($cate && Dever::project('category')) {
|
|
|
+ $attr_where['category'] = $ids;
|
|
|
+ $attr = Dever::db('category/attr')->getAttr($attr_where);
|
|
|
+ if ($attr) {
|
|
|
+ $value = array();
|
|
|
+ foreach ($attr as $k => $v) {
|
|
|
+ $value = array_merge($value, explode(',', $v['attr']));
|
|
|
+ }
|
|
|
+ $ids = array_unique($value);
|
|
|
+ }
|
|
|
+ print_r($ids);die;
|
|
|
+ }
|
|
|
+ $where['ids'] = $ids;
|
|
|
+ $where['search_reorder'] = 1;
|
|
|
+ $data = Dever::db('attr/info')->getSearch($where);
|
|
|
|
|
|
+ print_r($data);die;
|
|
|
$table = array();
|
|
|
- foreach ($result as $k => $v) {
|
|
|
- $table[$v['name']] = '';
|
|
|
- foreach ($v['attr'] as $k1 => $v1) {
|
|
|
- $table[$v['name']] .= $v1['name'] . " ";
|
|
|
- }
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return Dever::table($table);
|