add($data); return $res; } /** * 更新 * @param $map * @param $save * @return mixed */ public function updateOrder($map, $save) { $res = $this->where($map)->save($save); return $res; } /** * 获取一条 * @param $map * @param string $field * @return mixed */ public function getFind($map, $field = '*') { if (!isset($map['status'])) { $map['status'] = array('in', '1,2'); } $res = $this->field($field)->where($map)->find(); return $res; } /** * @param $map * @param string $field * @param string $order * @param string $page * @return mixed */ public function getSelect($map, $field = '*', $order = 'id asc', $page = '') { if (!isset($map['status'])) { $map['status'] = array('in', '1,2'); } if ($page) { $res = $this->field($field)->where($map)->order($order)->page($page)->select(); } else { $res = $this->field($field)->where($map)->order($order)->select(); } return $res; } /** * 获去数量 * @param $map * @return mixed */ public function getCount($map) { if (!isset($map['status'])) { $map['status'] = array('in', '1,2'); } $res = $this->where($map)->count(); return $res; } }