|
...
|
...
|
@@ -2,7 +2,9 @@ |
|
|
|
|
|
|
|
namespace App\Http\Logic\Aside\User;
|
|
|
|
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Http\Logic\Aside\BaseLogic;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\User\User;
|
|
|
|
|
|
|
|
class UserLogic extends BaseLogic
|
|
...
|
...
|
@@ -22,10 +24,16 @@ class UserLogic extends BaseLogic |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function user_info(){
|
|
|
|
$info = $this->model->read($this->param,['id','project_id','name','status','mobile','operator_id']);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('当前数据不存在');
|
|
|
|
$info = Common::get_user_cache($this->model,$this->param['id'],'A');
|
|
|
|
if(empty($info)){
|
|
|
|
$info = $this->model->read($this->param,['id','project_id','name','status','mobile','operator_id']);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('当前数据不存在');
|
|
|
|
}
|
|
|
|
$info['operator_name'] = (new User())->read(['id'=>$info['operator_id']],['name'])['name'];
|
|
|
|
$info['project_name'] = (new Project())->read(['id'=>$info['project_id']],['title'])['title'];
|
|
|
|
}
|
|
|
|
Common::set_user_cache($info,$this->model,$this->param['id'],'A');
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
/**
|
|
...
|
...
|
@@ -63,6 +71,7 @@ class UserLogic extends BaseLogic |
|
|
|
if($rs === false){
|
|
|
|
$this->fail('编辑失败');
|
|
|
|
}
|
|
|
|
Common::del_user_cache($this->model,$this->param['id'],'A');
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -73,11 +82,13 @@ class UserLogic extends BaseLogic |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function user_del(){
|
|
|
|
$ids = $this->param['id'];
|
|
|
|
$this->param['id'] = ['in',$this->param['id']];
|
|
|
|
$rs = $this->model->del($this->param);
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('删除失败');
|
|
|
|
}
|
|
|
|
Common::del_user_cache($this->model,$ids,'A');
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|