|
@@ -348,6 +348,37 @@ function bonus_output_mine($output)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function bonus_out_bindedtime($period)
|
|
|
+{
|
|
|
+ $min = 60;
|
|
|
+ $hour = 3600;
|
|
|
+ $day = 24 * 3600;
|
|
|
+
|
|
|
+ $days = intval($period / $day);
|
|
|
+ $period = $period % $day;
|
|
|
+ $houres = intval($period / $hour);
|
|
|
+ $period = $period % $hour;
|
|
|
+ $mins = intval($period / $min);
|
|
|
+
|
|
|
+ if($period % $min > 0) {
|
|
|
+ $mins += 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ $time_str = '';
|
|
|
+ if($days > 0) {
|
|
|
+ $time_str .= "{$days}天";
|
|
|
+ }
|
|
|
+ if($houres > 0) {
|
|
|
+ $time_str .= "{$houres}小时";
|
|
|
+ }
|
|
|
+ if($mins > 0) {
|
|
|
+ $time_str .= "{$mins}分钟";
|
|
|
+ }
|
|
|
+
|
|
|
+ $time_str .= "领完.";
|
|
|
+ return $time_str;
|
|
|
+}
|
|
|
+
|
|
|
function bonus_output_bindedinfo($output)
|
|
|
{
|
|
|
$type_info = $output['type_info'];
|
|
@@ -359,7 +390,7 @@ function bonus_output_bindedinfo($output)
|
|
|
$prompt = "{$type->getTotal_num()}个红包";
|
|
|
$prompt .= ",";
|
|
|
$period = $type_info['binded_period'];
|
|
|
- $prompt .= "{$period}分钟领完.";
|
|
|
+ $prompt .= bonus_out_bindedtime($period);
|
|
|
} else {
|
|
|
$prompt = "领取 {$type->binded_num()}/{$type->getTotal_num()}";
|
|
|
}
|