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