Browse Source

员工调整

lizhen_gitee 1 năm trước cách đây
mục cha
commit
0ecd1813d4
1 tập tin đã thay đổi với 5 bổ sung6 xóa
  1. 5 6
      application/api/controller/company/Staff.php

+ 5 - 6
application/api/controller/company/Staff.php

@@ -17,7 +17,7 @@ class Staff extends Apic
 
     //列表
     public function lists(){
-        $list = Db::name('company_staff')->where('company_id',$this->auth->id)->autopage()->select();
+        $list = Db::name('company_staff')->where('company_id',$this->auth->company_id)->autopage()->select();
 
         $this->success('success',$list);
     }
@@ -27,13 +27,13 @@ class Staff extends Apic
         $data = [
             'truename' => input('truename',''),
             'mobile' => input('mobile',''),
-            'company_id' => $this->auth->id,
+            'company_id' => $this->auth->company_id,
+            'type' => 2,
         ];
 
         //检查
-        $check1 = Db::name('company')->where('mobile',$data['mobile'])->find();
         $check2 = Db::name('company_staff')->where('mobile',$data['mobile'])->find();
-        if($check1 || $check2){
+        if($check2){
             $this->error('该手机已经被注册为员工或商户管理员');
         }
 
@@ -57,9 +57,8 @@ class Staff extends Apic
         ];
 
         //检查
-        $check1 = Db::name('company')->where('mobile',$data['mobile'])->find();
         $check2 = Db::name('company_staff')->where('id','neq',$id)->where('mobile',$data['mobile'])->find();
-        if($check1 || $check2){
+        if($check2){
             $this->error('该手机已经被注册为员工或商户管理员');
         }