isAjax()){ //分页参数 $length = input('rows',10,'intval'); //每页条数 $page = input('page',1,'intval'); //第几页 $start = ($page - 1) * $length; //分页开始位置 //排序 $sortRow = input('sidx','id','trim'); //排序列 $sort = input('sord','desc','trim'); //排序方式 $order = $sortRow.' '.$sort; $bh = input('bh','','trim'); if($bh){ $map[] = ['jjddjbh','=',$bh]; } if ($this->orgId != $this->org_Id) { $map[] = ['order_id','=',-1]; } $map= empty($map) ? true: $map; //数据查询 // $lists = Db::connect('db_config_jili')->name('wlps')->where($map)->limit($start,$length)->order($order)->select(); $lists = Db::name('wlps')->where($map)->limit($start,$length)->order($order)->select(); //数据返回 // $totalCount = Db::connect('db_config_jili')->name('wlps')->where($map)->count(); $totalCount = Db::name('wlps')->where($map)->count(); $totalPage = ceil($totalCount/$length); $result['page'] = $page; $result['total'] = $totalPage; $result['records'] = $totalCount; $result['rows'] = $lists; return json($result); }else{ return $this->fetch(); } } public function deal(){ $id = input('id','','intval'); // $info = Db::connect('db_config_jili')->name('wlps')->where('id',$id)->find(); $info = Db::name('wlps')->where('id',$id)->find(); if(!$info){ $this->error('记录不存在'); } if($info['is_deal'] != 2 || $info['is_qx'] != 'N'){ $this->error('该状态无法执行此操作'); } $ret = model('Wlps')->deal_wlps($info); if($ret){ $this->success('操作成功'); }else{ $this->error('操作失败,'.model('Wlps')->getError()); } } }