dever 6 anos atrás
pai
commit
22753c8385

+ 5 - 1
code/database/info.php

@@ -139,6 +139,7 @@ return array
 			'search'	=> 'select',
 			'update'	=> 'select',
 			'list'		=> true,
+			'mul'		=> array(1 => '恢复使用', 4 => '已作废'),
 		),
 
 		'seller_id'		=> array
@@ -223,6 +224,7 @@ return array
 		'delete' => false,
 		'edit' => false,
 		'insert' => false,
+		'mul' => '{type} == 1 || {type} == 4',
 
 		# 自定义快捷新增和编辑
         'button' => array
@@ -234,7 +236,9 @@ return array
 
         'list_button' => array
 		(
-			'oper' => array('作废', ''),
+			'oper' => array('作废', 'code/lib/manage.drop?id={id}', '{type} == 1'),
+
+			'oper2' => array('恢复使用', 'code/lib/manage.recovery?id={id}', '{type} == 4'),
 		),
 	),
 

+ 21 - 0
code/lib/Manage.php

@@ -65,4 +65,25 @@ class Manage
 			}
 		}
 	}
+
+	/**
+	 * 作废
+	 *
+	 * @return mixed
+	 */
+	public function drop_api($id)
+	{
+		$update['where_id'] = $id;
+		$update['type'] = 4;
+		Dever::db('code/info')->update($update);
+		return 'ok';
+	}
+
+	public function recovery_api($id)
+	{
+		$update['where_id'] = $id;
+		$update['type'] = 1;
+		Dever::db('code/info')->update($update);
+		return 'ok';
+	}
 }

+ 7 - 0
config/base.php

@@ -128,6 +128,13 @@ $config['base'] = array
 	# 注册成功后,是否发送短信,直接使用skin的key即可
 	//'regSendSms' => 'reg',
 
+	'passport_list_button' => array
+	(
+		'list1' => array('订单', '"order&project=journal&search_option_uid={id}&oper_parent=user&oper_project=passport"'),
+		'list2' => array('兑换码', '"info&project=code&search_option_uid={id}&oper_parent=user&oper_project=passport"'),
+		'list3' => array('积分', '"user_score&project=score&search_option_uid={id}&oper_parent=user&oper_project=passport"'),
+	),
+
 	# 支付成功后,调用的接口
 	'pay_notify' => 'service/lib/pay.act',
 );

+ 16 - 3
journal/database/order.php

@@ -291,6 +291,17 @@ return array
             'control'   => 'status',
         ),
 
+        'tk_pic'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '退款截图',
+            'default'   => '',
+            'desc'      => '退款截图',
+            'match'     => 'is_string',
+            'update'    => 'image',
+            'key'       => 1
+        ),
+
         'tk_time'       => array
         (
             'type'      => 'int-11',
@@ -299,6 +310,8 @@ return array
             'desc'      => '退款时间',
             'match'     => 'option',
             //'list'        => true,
+            //'update'    => 'date',
+            'callback'  => 'maketime',
             'show'      => 'status=5',
         ),
 
@@ -355,8 +368,8 @@ return array
             'match'     => 'option',
             'update'    => 'textarea',
             //'show'        => 'status=5'
-            'list'      => '"{info}" ? "{info}" : "双击添加备注"',
-            'edit'      => true,
+            //'list'      => '"{info}" ? "{info}" : "双击添加备注"',
+            //'edit'      => true,
         ),
 
         'mobile'        => array
@@ -398,7 +411,7 @@ return array
         ),
 
         'list_button' => array(
-            //'edit' => array('退款', 'tk_time,tk_desc,tk_admin', '{status} > 1'),
+            'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} > 1'),
             //'delete' => array('删除', '', '{status} == 1'),
         ),
     ),

+ 2 - 1
journal/lib/Manage.php

@@ -53,7 +53,8 @@ class Manage
                 $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['截图'] = '<a href="'.$info['tk_pic'].'" target="_blank"><img src="'.$info['tk_pic'].'" style="width:150px" /></a>';
+                //$table['退款时间'] = date('Y-m-d H:i:s', $info['tk_time']);
                 $table['操作人'] = $manage['username'];
                 return Dever::table($table);
             }

+ 4 - 0
main/src/Journal.php

@@ -807,6 +807,10 @@ class Journal extends Core
         }
 
         $source = Dever::input('source');
+        $system = Dever::input('system', 1);
+        if (!$source) {
+            $source = $system;
+        }
         if ($source) {
             $order_data['source'] = $source;
         }

+ 10 - 2
service/src/Base.php

@@ -22,8 +22,16 @@ class Base
         $this->type = $this->getConfig('type', 1);
         # 销售商
         $this->seller = $this->getConfig('seller', 1);
-        # 用户信息
+
+        $this->signature = Dever::input('signature');
+
         $this->user = Dever::load('passport/user')->data();
+        # 用户信息
+        if (!$this->user && $this->signature) {
+            $uid = Dever::load('passport/applet')->check();
+
+            $this->user = Dever::db('passport/user')->one($uid);
+        }
     }
 
     # 创建url
@@ -84,7 +92,7 @@ class Base
         $send['type'] = $this->type;
         $send['seller'] = $this->seller;
         $param['p'] = Dever::encode(Dever::json_encode($send), $this->key);
-
+        $param['signature'] = $this->signature;
     	$param = http_build_query($param);
     	$url = Dever::url($uri . '?' . $param, $project);