rabin 3 年之前
父节点
当前提交
1f87eb2aa2
共有 2 个文件被更改,包括 39 次插入5 次删除
  1. 38 4
      service/agent/database/order.php
  2. 1 1
      service/agent/lib/Manage.php

+ 38 - 4
service/agent/database/order.php

@@ -139,6 +139,10 @@ return array
     	'pay_type' => $pay_type,
         'order_type' => $order_type,
     ),
+    'start' => array
+    (
+        'update' => 'agent/lib/manage.orderUpdateParent',
+    ),
     'order' => 99,
     # 数据结构
     'struct' => array
@@ -207,6 +211,34 @@ return array
             //'list'      => true,
         ),
 
+        'invite_type'      => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '邀请类型',
+            'default'   => '1',
+            'desc'      => '邀请类型',
+            'match'     => 'is_numeric',
+            //'search'    => 'select',
+            'update'    => 'radio',
+            'option'    => $invite_type,
+            //'list'        => true,
+            //'list_order' => 7,
+            'control'   => 'invite_type',
+        ),
+
+        'parent_code'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '上级邀请码',
+            'default'   => '',
+            'desc'      => '上级邀请码',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            # 绑定js脚本,更新时使用,第一个参数是执行的方式,第二个参数执行的方法,第三个参数是传值。
+            'bind'        => array('onblur', 'loading', array('url' => Dever::url("lib/member.search", 'agent'))),
+            'show'   => 'invite_type=1',
+        ),
+
         'parent_mid'      => array
         (
             'type'      => 'int-11',
@@ -214,7 +246,7 @@ return array
             'default'   => '-1',
             'desc'      => '邀请人',
             'match'     => 'is_string',
-            'update'    => 'text',
+            //'update'    => 'text',
             'search'    => $parent_mid ? 'hidden' : array
             (
                 'api' => 'agent/member-find',
@@ -224,6 +256,7 @@ return array
             'list_name'      => '邀请人',
             'list'      => 'Dever::load("agent/lib/member.getOne", {parent_mid})',
             'list_order' => 4,
+            
         ),
 
         'source_id'      => array
@@ -234,10 +267,11 @@ return array
             'desc'      => '注册来源',
             'match'     => 'is_numeric',
             'search'    => 'select',
-            'update'    => 'checkbox',
+            'update'    => 'radio',
             'option'    => $source_id,
             'list'      => true,
             'list_order' => 5,
+            'show'   => 'invite_type=2',
         ),
 
         'name'      => array
@@ -321,8 +355,8 @@ return array
 			'default' 	=> '1',
 			'desc' 		=> '支付方式',
 			'match' 	=> 'is_numeric',
-			'search'	=> 'select',
-			'update'	=> 'select',
+			//'search'	=> 'select',
+			//'update'	=> 'select',
 			'option'	=> $pay_type,
 			//'list'		=> true,
             //'list_order' => 7,

+ 1 - 1
service/agent/lib/Manage.php

@@ -113,7 +113,7 @@ class Manage
                 if (!$member) {
                     Dever::alert('错误的邀请码');
                 }
-                $order = Dever::db('agent/order')->find($id);
+                $order = Dever::db('agent/order')->find($id['where_id']);
                 if ($order['mid'] == $member['id']) {
                     Dever::alert('邀请人不能是自己');
                 }