|
...
|
...
|
@@ -3,9 +3,11 @@ |
|
|
|
namespace App\Http\Logic\Aside\Manage;
|
|
|
|
|
|
|
|
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Http\Logic\Aside\BaseLogic;
|
|
|
|
use App\Models\Manage\Manage;
|
|
|
|
use App\Models\Manage\Menu;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -31,18 +33,21 @@ class ManageLogic extends BaseLogic |
|
|
|
* @time :2023/9/11 9:34
|
|
|
|
*/
|
|
|
|
public function managerSave(){
|
|
|
|
try {
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
if(isset($this->param['password']) && !empty($this->param['password'])){
|
|
|
|
$this->param['password'] = Hash::make($this->param['password']);
|
|
|
|
}
|
|
|
|
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
Common::del_user_cache('manager',$this->param['id'],'A');
|
|
|
|
}else{
|
|
|
|
$this->param['password'] = Hash::make($this->param['password']);
|
|
|
|
$rs = $this->model->add($this->param);
|
|
|
|
$this->model->add($this->param);
|
|
|
|
}
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('error');
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -70,13 +75,31 @@ class ManageLogic extends BaseLogic |
|
|
|
* @time :2023/8/28 16:10
|
|
|
|
*/
|
|
|
|
public function getManagerInfo(){
|
|
|
|
$info = Common::get_user_cache('manager',$this->param['id'],'A');
|
|
|
|
if(empty($info)){
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']],
|
|
|
|
['id','name','email','mobile','status','gid','sort','dept_id','is_dept_manager','created_at','role','updated_at']);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
Common::set_user_cache('manager',$this->param['id'],'A');
|
|
|
|
}
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :删除
|
|
|
|
* @name :managerDelete
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/15 10:45
|
|
|
|
*/
|
|
|
|
public function managerDelete(){
|
|
|
|
$rs = $this->model->del(['id'=>['in',$this->param['ids']]]);
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
Common::del_user_cache('manager',$this->param['ids'],'A');
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|