diff --git a/app/contract/controller/Api.php b/app/contract/controller/Api.php index e30d8f6..0a8a0ef 100644 --- a/app/contract/controller/Api.php +++ b/app/contract/controller/Api.php @@ -14,7 +14,7 @@ use think\facade\View; class Api extends BaseController { - //获取项目概况数据 + //获取合同协议 public function get_contract() { $param = get_params(); @@ -23,14 +23,17 @@ class Api extends BaseController $where[] = ['id|name', 'like', '%' . $param['keywords'] . '%']; } $where[] = ['delete_time', '=', 0]; - $list = Db::name('Contract')->field('id,name,sign_uid,sign_time')->order('end_time asc')->where($where)->select()->toArray(); - if (!empty($list)) { - foreach ($list as $k => &$v) { - $v['sign_name'] = Db::name('Admin')->where('id',$v['sign_uid'])->value('name'); - $v['sign_time'] = date('Y-m-d', $v['sign_time']); - } - } - to_assign(0, '', $list); + $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; + $list = Db::name('Contract') + ->field('id,name,sign_uid,sign_time') + ->order('end_time asc') + ->where($where) + ->paginate($rows, false)->each(function($item, $key){ + $item['sign_name'] = Db::name('Admin')->where('id',$item['sign_uid'])->value('name'); + $item['sign_time'] = date('Y-m-d', $item['sign_time']); + return $item; + }); + table_assign(0, '', $list); } //添加附件 diff --git a/app/contract/view/index/index.html b/app/contract/view/index/index.html index 23375a5..6d3fe54 100644 --- a/app/contract/view/index/index.html +++ b/app/contract/view/index/index.html @@ -232,14 +232,16 @@ function selectCharge(type){ layer.open({ title:'选择母合同', - area:['680px','556px'], + area:['680px','580px'], type:1, - content:'
\ -
\ - \ - \ + content:'
\ + \ +
\ + \ +
\ + \ \ -
', +
', success:function(){ table_b=table.render({ elem: '#boxcontract'