Your Name 2 years ago
parent
commit
f6fda8dce4
3 changed files with 47 additions and 7 deletions
  1. 1 1
      learn/active/database/info.php
  2. 28 4
      learn/active/database/order.php
  3. 18 2
      learn/active/lib/Manage.php

+ 1 - 1
learn/active/database/info.php

@@ -96,7 +96,7 @@ return array
 
         'desc'      => array
         (
-            'type'      => 'varchar-500',
+            'type'      => 'text-1000',
             'name'      => '活动说明',
             'default'   => '',
             'desc'      => '活动说明',

+ 28 - 4
learn/active/database/order.php

@@ -1,6 +1,10 @@
 <?php
 $excel = false;
 $excel[] = array('数据导出','数据导出','active/lib/excel.out_active_order');
+$list_button = array();
+if (Dever::load('manage/auth')->checkFunc('active.order', 'editRefund', '全额退款')) {
+    $list_button['oper'] = array('全额退款', '"active/lib/manage.refund?id={id}"', '{status} == 2');
+}
 $pay_type = array
 (
     1 => '在线支付',
@@ -161,6 +165,29 @@ return array
             //'list'      => true,
         ),
 
+        'refund_admin' => array
+        (
+            'type'      => 'int-11',
+            'name'      => '退款操作人',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list_name' => '退款操作人<br>退款时间',
+            'list'        => 'Dever::load("active/lib/manage.show",{id})',
+        ),
+
+        'rdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '退款时间',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'search'    => 'date',
+            // 'desc'      => '',
+            // 'list'      => 'date("Y-m-d H:i:s", {zdate})',
+        ),
+
         'state'     => array
         (
             'type'      => 'tinyint-1',
@@ -190,10 +217,7 @@ return array
         'edit' => false,
         'insert' => false,
         'excel'	=> $excel,
-        'list_button' => array
-        (
-        	'oper'  => array('全额退款', '"active/lib/manage.refund?id={id}"', '{status} == 2'),
-        ),
+        'list_button' => $list_button,
     ),
 
     'request' => array

+ 18 - 2
learn/active/lib/Manage.php

@@ -28,10 +28,26 @@ Class Manage {
                 # 退款失败,抛出错误
                 //throw new \Exception('退款失败');
                 Dever::alert('退款失败,请联系管理员');
-            }else{
-            	Dever::db('active/order')->update(array('where_id'=>$id,'set_status'=>6));
+            }else{ 
+                $admin = Dever::load('manage/auth.data');
+                $time = time();
+            	Dever::db('active/order')->update(array('where_id'=>$id,'set_status'=>6,'set_refund_admin'=>$admin,'set_rdate'=>$time));
             }
         }
   		return 'reload';
 	}
+
+    public function show_api($id){
+        $data = Dever::db('active/order')->find($id);
+        $refund_admin = '-';
+        $rdate = '-';
+        if ($data && isset($data['refund_admin']) && $data['refund_admin'] && $data['refund_admin']>0 && $data['rdate']) {
+            $admin = Dever::load('manage/admin-find',$v['refund_admin']);
+            $refund_admin = $admin['name'];
+            $rdate = date('Y-m-d H:i',$data['rdate']);
+        }
+        $html = $refund_admin.'<br/>'.$rdate;
+        // print_R($html);die;
+        return $html;
+    }
 }