|
@@ -574,6 +574,16 @@ class merchantControl extends SystemControl
|
|
|
foreach ($order_list as $order_id => $order_info) {
|
|
|
$order_list[$order_id]['card_type_text'] = $this->scard_type($order_info['card_type']);
|
|
|
$order_list[$order_id]['mch_name'] = $merchants[$order_info['mchid']]['company_name'];
|
|
|
+ if($order_info['notify_time'] > 0)
|
|
|
+ {
|
|
|
+ $order_list[$order_id]['diff_time_text'] = $this->elapse_time($order_info['notify_time'] - $order_info['order_time']);
|
|
|
+ $order_list[$order_id]['diff_time'] = $order_info['notify_time'] - $order_info['order_time'];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $order_list[$order_id]['diff_time_text'] = $this->elapse_time(time() - $order_info['order_time']);
|
|
|
+ $order_list[$order_id]['diff_time'] = time() - $order_info['order_time'];
|
|
|
+ }
|
|
|
}
|
|
|
Tpl::output('stat', $stat[0]);
|
|
|
Tpl::output('order_list', $order_list);
|
|
@@ -813,4 +823,36 @@ class merchantControl extends SystemControl
|
|
|
return '未知';
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private function elapse_time($seconds)
|
|
|
+ {
|
|
|
+ $minutes = intval($seconds / 60);
|
|
|
+ $second = intval($seconds % 60);
|
|
|
+ if($minutes >= 60) {
|
|
|
+ $minute = $minutes % 60;
|
|
|
+ $hours = intval($minutes / 60);
|
|
|
+ $result = "{$minute}分钟{$second}秒";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $result = "{$minutes}分钟{$second}秒";
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isset($hours))
|
|
|
+ {
|
|
|
+ if($hours >= 24) {
|
|
|
+ $hour = $hours % 24;
|
|
|
+ $day = intval($hours / 24);
|
|
|
+ $result = "{$hour}小时" . $result;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $result = "{$hours}小时" . $result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isset($day) && $day > 0) {
|
|
|
+ $result = "{$day}天" . $result;
|
|
|
+ }
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
}
|