|
@@ -491,22 +491,35 @@ Class Manage
|
|
|
// }
|
|
|
$active = Dever::db('active/info')->find($v['active_id']);
|
|
|
$m = '';
|
|
|
- if ($v['status'] == 1 && $active['refund_type'] == 2 ) {
|
|
|
+ if ($active['refund_type'] == 2 ) {
|
|
|
// && time()<$active['act_start']
|
|
|
if ($active['off_type'] == 2) {
|
|
|
+ // print_r($v);die;
|
|
|
if ($v['status']!=3) {
|
|
|
$url = Dever::url('project/database/update?project=active&table=info_refund_log&search_option_price='.$active['price'].'&search_option_code_id='.$v['id'].'&search_option_order_id='.$id.'&col=price,order_id,code_id,desc', 'manage');
|
|
|
+ $name = '退款';
|
|
|
}
|
|
|
+ } else if ($active['refundagin_type'] == 2) {
|
|
|
+ if ($v['status'] == 3) {
|
|
|
+ $log = Dever::db('active/info_refund_log')->find(array('code_id'=>$v['id'],'status'=>2));
|
|
|
+ if ($log['price'] < $active['price']) {
|
|
|
+ $url = Dever::url('project/database/update?project=active&table=info_refund_log&search_option_price='.$active['price'].'&search_option_code_id='.$v['id'].'&search_option_order_id='.$id.'&col=price,order_id,code_id,desc', 'manage');
|
|
|
+ $name = '再次退款';
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
if ($v['status']==1) {
|
|
|
$url = Dever::url('project/database/update?project=active&table=info_refund_log&search_option_price='.$active['price'].'&search_option_code_id='.$v['id'].'&search_option_order_id='.$id.'&col=price,order_id,code_id,desc', 'manage');
|
|
|
+ $name = '退款';
|
|
|
}
|
|
|
}
|
|
|
- // $url = Dever::url('lib/manage.setOrder&order_id=' . $v['order_id'].'&code_id='.$v['id'].'&col=price', 'active');
|
|
|
-
|
|
|
if (Dever::load('manage/auth')->checkFunc('active.order', 'editorder', '退款')) {
|
|
|
- $m = '<a href="javascript:;" onclick="fastEdit($(this), \''.$url.'\')" class="layui-btn">退款</a>';
|
|
|
+ if (isset($url) && $url) {
|
|
|
+ $m = '<a href="javascript:;" onclick="fastEdit($(this), \''.$url.'\')" class="layui-btn">'.$name.'</a>';
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ // $url = Dever::url('lib/manage.setOrder&order_id=' . $v['order_id'].'&code_id='.$v['id'].'&col=price', 'active');
|
|
|
}
|
|
|
|
|
|
$d = array
|
|
@@ -548,9 +561,14 @@ Class Manage
|
|
|
if ($price > $active['price']) {
|
|
|
Dever::alert('退款金额大于购买金额');
|
|
|
}
|
|
|
- $data = Dever::db('active/info_refund_log')->find(Array('order_id'=>$order_id,'code_id'=>$code_id));
|
|
|
+ $data = Dever::db('active/info_refund_log')->find(Array('order_id'=>$order_id,'code_id'=>$code_id,'status'=>2));
|
|
|
if($data) {
|
|
|
- // Dever::alert('不可重复退款');
|
|
|
+ if (isset($data['price']) && $data['price']) {
|
|
|
+ $tprice = $price+$data['price'];
|
|
|
+ if ($t_price>$active['price']) {
|
|
|
+ Dever::alert('退款金额大于购买金额');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
public function updateInfoRefundLog($id,$name,$data)
|