function getList($cols = '*', $filter = array(), $offset = 0, $limit = -1, $orderType = null) { if (!$cols) { $cols = $this->defaultCols; } if (!empty($this->appendCols)) { $cols .= ',' . $this->appendCols; } if ($this->use_meta) { $meta_info = $this->prepare_select($cols); } $orderType = $orderType ? $orderType : $this->defaultOrder; $sql = 'SELECT ' . $cols . ' FROM `' . $this->table_name(true) . '` WHERE ' . $this->_filter($filter); if ($orderType) { $sql .= ' ORDER BY ' . (is_array($orderType) ? implode($orderType, ' ') : $orderType); } $data = $this->db->selectLimit($sql, $limit, $offset); $this->tidy_data($data, $cols); if ($this->use_meta && count($meta_info['metacols']) && $data) { foreach ($meta_info['metacols'] as $col) { $obj_meta = new dbeav_meta($this->table_name(true), $col, $meta_info['has_pk']); $obj_meta->select($data); } } return $data; }
/** * 重写getList方法 */ public function getList($cols = '*', $filter = array(), $offset = 0, $limit = -1, $orderType = null) { if (!$cols) { $cols = $this->defaultCols; } if (!empty($this->appendCols)) { $cols .= ',' . $this->appendCols; } if ($this->use_meta) { $meta_info = $this->prepare_select($cols); } $orderType = $orderType ? $orderType : $this->defaultOrder; $sql = 'SELECT ' . $cols . ' FROM `' . $this->table_name(true) . '` WHERE ' . $this->_filter_sql($filter); if ($orderType) { $sql .= ' ORDER BY ' . (is_array($orderType) ? implode($orderType, ' ') : $orderType); } $data = $this->db->selectLimit($sql, $limit, $offset); $this->tidy_data($data, $cols); if ($this->use_meta && count($meta_info['metacols']) && $data) { foreach ($meta_info['metacols'] as $col) { $obj_meta = new dbeav_meta($this->table_name(true), $col, $meta_info['has_pk']); $obj_meta->select($data); } } $arr_list = $data; $obj_extends_order_service = kernel::serviceList('b2c_order_extends_actions'); if ($obj_extends_order_service) { foreach ($obj_extends_order_service as $obj) { $obj->extend_list($arr_list); } } $info_object = kernel::service('sensitive_information'); if (is_object($info_object)) { $info_object->opinfo($arr_list, 'b2c_mdl_orders', __FUNCTION__); } return $arr_list; }