rabin 3 years ago
parent
commit
ed879a940c
3 changed files with 55 additions and 0 deletions
  1. 1 0
      app/cash/lib/Set.php
  2. 49 0
      service/option/database/member.php
  3. 5 0
      service/option/lib/Member.php

+ 1 - 0
app/cash/lib/Set.php

@@ -103,6 +103,7 @@ class Set
             Dever::db($table)->update(array('where_id' => $id, 'status' => 2));
 
             if ($type == 'shop_sell' && $data['cash'] > 0) {
+                return;
                 $card = Dever::db('cash/order')->getCardAll(array('start'=>$data['start'],'end'=>$data['end'],'pay_type'=>2,'status'=>2,'type'=>1,'type_id'=>$data['shop_id'],'state'=>1));
                 $shop = Dever::db('shop/info')->find($data['shop_id']);
                 if ($card && $card['cash'] > 0) {

+ 49 - 0
service/option/database/member.php

@@ -24,6 +24,24 @@ $role = array
     2 => '公司员工',
 );
 
+# 获取公司权限
+$auth = Dever::tops();
+$company = function() use ($auth)
+{
+    $array = array();
+    if ($auth) {
+        $info = Dever::db('option/company')->getIds(array('ids' => $auth));
+    } else {
+        $info = Dever::db('option/company')->state();
+    }
+    
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
+
 $search_auth = Dever::input('search_option_dever_auth', 1);
 
 $list_button = array();
@@ -79,6 +97,19 @@ return array
             //'list'        => true,
         ),
 
+        'company_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '所属公司',
+            'default'   => '1',
+            'desc'      => '所属公司',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $company,
+            'search'    => 'select',
+            //'list'      => true,
+        ),
+
         'main'        => array
         (
             'type'      => 'tinyint-1',
@@ -218,6 +249,24 @@ return array
         ),
     ),
 
+    # 设置top权限
+    'top' => 'option/company_id',
+
+    # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
+    'top_option' => array
+    (
+        array
+        (
+            'value' => $auth,
+            'col' => 'company_id',
+        ),
+        array
+        (
+            'value' => Dever::load('manage/auth.authData'),
+            'col' => 'id',
+        ),
+    ),
+
     'manage' => array
     (
         'insert' => false,

+ 5 - 0
service/option/lib/Member.php

@@ -14,6 +14,11 @@ class Member
         $account = Dever::db('option/member')->find($id);
         if ($account) {
             $string = $account['name'] . '<br />' . $account['mobile'] . '<br />' . $account['idcard'] . '<br />' . $account['key'];
+
+            $company = Dever::db('option/company')->find($account['company_id']);
+            if ($company) {
+                $string .= '<br />' . $company['name'];
+            }
             return $string;
             
         } else {