rabin 3 years ago
parent
commit
94d894b802

+ 5 - 0
service/agent/database/order_process.php

@@ -50,6 +50,11 @@ return array
     'lang' => '订单审核进度表',
     'menu' => false,
     'status' => $status,
+    'start' => array
+    (
+        'insert' => 'agent/lib/manage.orderStartUpdate',
+        'update' => 'agent/lib/manage.orderStartUpdate',
+    ),
     'end' => array
     (
         'insert' => 'agent/lib/manage.orderUpdate',

+ 19 - 0
service/agent/lib/Manage.php

@@ -125,6 +125,25 @@ class Manage
         }
     }
 
+    public function orderStartUpdate($id, $name, $data)
+    {
+        Dever::config('base')->hook = true;
+        $order_id = Dever::param('order_id', $data);
+        if (!$order_id) {
+            Dever::alert('订单错误');
+        }
+        $order = Dever::db('agent/order')->find($order_id);
+        if ($order && $order['source_id'] < 0) {
+            if ($order['parent_mid'] > 0) {
+                $member = Dever::db('agent/member')->find($order['parent_mid']);
+                if ($member['status'] == 2) {
+                    return;
+                }
+            }
+            Dever::alert('直属上级未认证,无法进行初审');
+        }
+    }
+
     public function orderUpdate($id, $name, $data)
     {
         Dever::config('base')->hook = true;

+ 29 - 8
service/agent/lib/Order.php

@@ -541,7 +541,7 @@ class Order
             ),
         );
 
-        $button = $this->show_button($process, $info, $role);
+        $button = $this->show_button($process, $info, $role, $parent_member);
 
         if (($info['status'] == 3 || $info['status'] == 4) && $info['agent_cash'] > 0) {
 
@@ -572,7 +572,7 @@ class Order
         return $html;
     }
 
-    private function show_button($process, $info, $role)
+    private function show_button($process, $info, $role, $parent_member)
     {
         $button = array();
         $cstatus = ',cstatus,soft_price';
@@ -638,12 +638,33 @@ class Order
             if (isset($process[1]) && $process[1]) {
                 $purl .= '&where_id=' . $process[1]['id'];
             }
-            $button[] = array
-            (
-                'type' => 'edit',
-                'link' => $purl,
-                'name' => '业务初审',
-            );
+
+            if ($parent_member) {
+                if ($parent_member['status'] == 2) {
+                    $button[] = array
+                    (
+                        'type' => 'edit',
+                        'link' => $purl,
+                        'name' => '业务初审',
+                    );
+                } else {
+                    $button[] = array
+                    (
+                        'type' => 'click',
+                        'content' => 'showCs()',
+                        'name' => '业务初审<script>function showCs(){layer.msg("直属上级未认证,无法进行初审")}</script>'
+                    );
+                }
+                
+            } else {
+                $button[] = array
+                (
+                    'type' => 'edit',
+                    'link' => $purl,
+                    'name' => '业务初审',
+                );
+            }
+            
         } elseif ($info['status'] == 2) {
             
             $purl = Dever::url('project/database/update?project=agent&table=order_process&order_id='.$info['id'].'&status=2&col=order_id,status,audit,desc', 'manage');