insertGetId($data); } /** * 更新 * @access public * @author csdeshang * @param array $update_array 更新数据 * @param array $condition 更新条件 * @return bool */ public function editComplainsubject($update_array, $condition) { return Db::name('complainsubject')->where($condition)->update($update_array); } /** * 删除投诉主题 * @access public * @author csdeshang * @param array $condition 检索条件 * @return bool */ public function delComplainsubject($condition) { return Db::name('complainsubject')->where($condition)->delete(); } /** * 获得投诉主题列表 * @access public * @author csdeshang * @param array $condition 检索条件 * @param int $pagesize 分页信息 * @param str $order 排序 * @return array */ public function getComplainsubject($condition = '', $pagesize = '',$order = 'complainsubject_id desc') { if($pagesize){ $res= Db::name('complainsubject')->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false); $this->page_info=$res; return $res->items(); }else{ return Db::name('complainsubject')->where($condition)->order($order)->select()->toArray(); } } /** * 获得有效投诉主题列表 * @access public * @author csdeshang * @param array $condition 检索条件 * @param int $pagesize 分页信息 * @param str $order 排序 * @return array */ public function getActiveComplainsubject($condition = '', $pagesize = '',$order='complainsubject_id desc ') { //搜索条件 $condition[] = array('complainsubject_state','=',1); if($pagesize){ $res=Db::name('complainsubject')->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false); $this->page_info=$res; return $res->items(); }else{ return Db::name('complainsubject')->where($condition)->order($order)->select()->toArray(); } } }