|
@@ -310,6 +310,30 @@ class Buy
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $info = $this->refund_button($info);
|
|
|
+
|
|
|
+ return $info;
|
|
|
+ }
|
|
|
+
|
|
|
+ # 是否可以退款
|
|
|
+ public function refund_button($info)
|
|
|
+ {
|
|
|
+ $info['refund_button'] = -1;
|
|
|
+ # 是否显示退款按钮
|
|
|
+ $manage_config = Dever::db('main/manage_config')->find();
|
|
|
+
|
|
|
+ $refund_time = $manage_config['buy_refund_day']*86400;
|
|
|
+
|
|
|
+ if ($refund_time > 0 && ($info['status'] == 8 || $info['status'] == 6)) {
|
|
|
+ $cur = time();
|
|
|
+ if ($cur - $info['fdate'] < $refund_time) {
|
|
|
+ # 可以退款
|
|
|
+ $info['refund_button'] = 1;
|
|
|
+ } else {
|
|
|
+ # 不可以退款
|
|
|
+ $info['refund_button'] = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
return $info;
|
|
|
}
|
|
|
|
|
@@ -1291,10 +1315,14 @@ class Buy
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if ($info['status'] == 3) {
|
|
|
- $status = '<a href="javascript:;" onclick="fastEdit($(this), \''.$tui.'\', \'缺货退款\', \'\', 1)" class="layui-btn">缺货退款</a>';
|
|
|
- } elseif ($info['status'] == 4) {
|
|
|
- $status = '<a href="javascript:;" onclick="fastEdit($(this), \''.$tui.'\', \'报损退款\', \'\', 1)" class="layui-btn">报损退款</a>';
|
|
|
+
|
|
|
+ $info = $this->refund_button($info);
|
|
|
+ if ($info['refund_button'] == 1) {
|
|
|
+ if ($info['status'] == 3) {
|
|
|
+ $status = '<a href="javascript:;" onclick="fastEdit($(this), \''.$tui.'\', \'缺货退款\', \'\', 1)" class="layui-btn">缺货退款</a>';
|
|
|
+ } elseif ($info['status'] == 4) {
|
|
|
+ $status = '<a href="javascript:;" onclick="fastEdit($(this), \''.$tui.'\', \'报损退款\', \'\', 1)" class="layui-btn">报损退款</a>';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|