diff --git a/app/common.php b/app/common.php index f9f6053..518a105 100644 --- a/app/common.php +++ b/app/common.php @@ -1510,10 +1510,7 @@ function advancedDate($type) } /** - * 间隔时间段格式化 - * @param int $time 时间戳 - * @param string $format 格式 【d:显示到天 i显示到分钟 s显示到秒】 - * @return string + * 计算按天数 */ function countDays($a, $b = 0) { diff --git a/app/contract/model/Contract.php b/app/contract/model/Contract.php index 6377831..814adb5 100644 --- a/app/contract/model/Contract.php +++ b/app/contract/model/Contract.php @@ -65,6 +65,7 @@ class Contract extends Model $item->type_name = self::$Type[(int)$item->type_a]; $item->status_name = self::$Status[(int)$item->check_status]; $item->chack_status_name = self::$Status[(int) $item->CheckStatus]; + $item->delay = countDays(date("Y-m-d"),date('Y-m-d', $item->end_time)); if($item->cost == 0){ $item->cost = '-'; } diff --git a/app/contract/view/index/index.html b/app/contract/view/index/index.html index 45b65c9..1d40a7e 100644 --- a/app/contract/view/index/index.html +++ b/app/contract/view/index/index.html @@ -93,6 +93,21 @@ var html = '' + d.type_name + ''; return html; } + },{ + field: 'interval_time', + title: '合同有效时间', + align: 'center', + width: 248, + templet: function (d) { + var html = d.interval_time; + if (d.delay > 0 && d.delay < 30) { + html += '' + d.delay + '天后到期'; + } + if (d.delay == 0) { + html += '已过期'; + } + return html; + } },{ field: 'cost', title: '合同金额/元',