Your Name 3 лет назад
Родитель
Сommit
35db399010
2 измененных файлов с 28 добавлено и 4 удалено
  1. 12 4
      learn/active/database/code.php
  2. 16 0
      learn/active/lib/Manage.php

+ 12 - 4
learn/active/database/code.php

@@ -34,6 +34,12 @@ if (Dever::load('manage/auth')->checkFunc('active.code', 'editExcelCode', '数
 }
 $button = array();
 $button['导入订单'] = array('fast', '', 'import&project=upload&call=active/lib/excel.import');
+$list_button = array();
+$list_button['fast'] = array('添加座位号', '"code&where_id={id}&col=seat_num&oper_save_jump=code&oper_table=code&oper_parent=code"');
+if (Dever::load('manage/auth')->checkFunc('active.code', 'edithexiaocode', '核销')) {
+    $list_button['oper1'] = array('核销', '"active/lib/manage.upCode?id={id}"', "{status} == 1");
+}
+            
 return array
 (
     # 表名
@@ -280,10 +286,12 @@ return array
         'edit' => false,
         'excel' => $excel,
         'button' => $button,
-        'list_button' => array
-        (
-            'fast' => array('添加座位号', '"code&where_id={id}&col=seat_num&oper_save_jump=code&oper_table=code&oper_parent=code"'),
-        ),
+        'list_button' => $list_button,
+        // array
+        // (
+        //     'fast' => array('添加座位号', '"code&where_id={id}&col=seat_num&oper_save_jump=code&oper_table=code&oper_parent=code"'),
+        //     'oper1' => array('手动核销', '"active/lib/manage.upCode?id={id}"', "{status} == 1"),
+        // ),
     ),
 
     'request' => array

+ 16 - 0
learn/active/lib/Manage.php

@@ -5,6 +5,22 @@ namespace Active\Lib;
 use Dever;
 Class Manage 
 {
+    public function upCode_api($id)
+    {
+        $id = Dever::input('id');
+        if ($id) {
+            $data = Dever::db('active/code')->find($id);
+            if ($data && $data['status'] == 1) {
+                $where['where_id'] = $id;
+                $where['status'] = 2;
+                $admin = Dever::load('manage/auth.info');
+                $where['audit_admin'] = $admin['id'];
+                Dever::db('active/code')->update($where);
+                // echo Dever::sql();die;
+            }
+        }
+        return 'reload';
+    }
 	#全额退款
 	public function refund_api($id)
     {