dever 6 years ago
parent
commit
7a89c578ce
2 changed files with 23 additions and 1 deletions
  1. 1 1
      journal/database/order.php
  2. 22 0
      journal/lib/Manage.php

+ 1 - 1
journal/database/order.php

@@ -182,7 +182,7 @@ return array
             'option'    => $status,
             'search'    => 'select',
             'update'    => 'radio',
-            //'list'      => 'Dever::load("service/lib/manage.showOrderStatus", "{id}")',
+            'list'      => 'Dever::load("journal/lib/manage.showOrderStatus", "{id}")',
             'control'   => 'status',
         ),
 

+ 22 - 0
journal/lib/Manage.php

@@ -34,6 +34,28 @@ class Manage
         return Dever::table($table);
     }
 
+    public function showOrderStatus($id)
+    {
+        $info = Dever::db('journal/order')->one($id);
+        if ($info) {
+            if ($info['status'] == 1) {
+                #return '*已支付';
+                return '待支付';
+            } elseif ($info['status'] == 2) {
+                return '已支付';
+            } elseif ($info['status'] == 3) {
+                return '支付失败';
+            } elseif ($info['status'] == 5) {
+                $table['状态'] = '已退款';
+                $manage = Dever::db('manage/admin')->one($info['tk_admin']);
+                $table['备注'] = $info['tk_desc'];
+                $table['退款时间'] = date('Y-m-d H:i:s', $info['tk_time']);
+                $table['操作人'] = $manage['username'];
+                return Dever::table($table);
+            }
+        }
+    }
+
 	private function search($table = 'content/article')
 	{
 		$keyword = Dever::input('keyword');