作者 lyh

gx

... ... @@ -17,10 +17,10 @@ class HrController extends BaseController
* @method :post
* @time :2023/7/24 11:56
*/
public function list(HrLogic $logic)
public function list(ManageHr $manageHr)
{
$lists = $logic->getHrList($this->map,$this->page,$this->row,$this->order);
if(!empty($lists['list'])){
$lists = $manageHr->lists($this->map,$this->page,$this->row,$this->order);
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$v['photo_gallery_link'] = json_decode($v['photo_gallery']);
$v['id_card_gallery_link'] = json_decode($v['id_card_gallery']);
... ...
... ... @@ -166,10 +166,7 @@ class ImageController extends Controller
if ($type == 'multi') {
return $this->multi($files);
}else{
$size = $files->getSize();
$image_type = $files->getClientOriginalExtension();
$mime = $files->getMimeType();
return $this->single($files,$size,$image_type,$mime);
return $this->single($files);
}
}
... ... @@ -181,14 +178,23 @@ class ImageController extends Controller
* @method :post
* @time :2023/6/17 16:30
*/
public function single(&$files,$size,$image_type,$mime){
public function single(&$files){
$size = $files->getSize();
$image_type = $files->getClientOriginalExtension();
$mime = $files->getMimeType();
$hash = hash_file('md5', $files->getPathname());
//查看文件是否存在
$imageModel = new ImageModel();
$image_hash = $imageModel->read(['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0]);
//查看图片是否已上传
$param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0];
if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
$param['project_id'] = $this->cache['project_id'];
}
$image_hash = $imageModel->read($param);
if($image_hash !== false){
return $this->response('图片资源',Code::SUCCESS,$this->responseData($image_hash['path']));
}
//保存路径
$url = $this->config['root'].$this->path;
$fileName = uniqid().rand(10000,99999).'.'.$image_type;
//上传到cos
... ... @@ -196,10 +202,7 @@ class ImageController extends Controller
$cosService = new CosService();
$cosService->uploadFile($files,$this->path,$fileName);
}else{
$res = $files->move($url,$fileName);
if ($res === false) {
return $this->response($files->getError(), Code::USER_ERROR);
}
$files->move($url,$fileName);
}
$this->saveMysql($imageModel,$size,$image_type,$fileName,$hash,$this->upload_location,$mime);
return $this->response('图片资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName));
... ... @@ -230,10 +233,8 @@ class ImageController extends Controller
}
return true;
}
/**
* @param $info
* @param $w
* @param $h
* @remark :生成缩略图
* @name :cacheImage
* @author :lyh
... ... @@ -248,7 +249,6 @@ class ImageController extends Controller
}
/**
* @param $files
* @remark :多图片上传
* @name :multi
* @author :lyh
... ... @@ -263,7 +263,12 @@ class ImageController extends Controller
$mime = $file->getMimeType();
$imageModel = new ImageModel();
$hash = hash_file('md5', $file->getPathname());
$image_hash = $imageModel->read(['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0]);
//查看图片是否已上传
$param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0];
if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
$param['project_id'] = $this->cache['project_id'];
}
$image_hash = $imageModel->read($param);
if($image_hash !== false){
$data[] = $this->responseData($image_hash['path']);
continue;
... ... @@ -275,10 +280,7 @@ class ImageController extends Controller
$cosService = new CosService();
$cosService->uploadFile($file,$this->path,$fileName);
}else{
$res = $file->move($url,$fileName);
if ($res === false) {
$this->response($file->getError(), Code::USER_ERROR);
}
$file->move($url,$fileName);
}
//批量存储
$this->saveMysql($imageModel,$size,$image_type,$fileName,$hash,$this->upload_location,$mime);
... ...
... ... @@ -46,15 +46,9 @@ class LoginLogic extends BaseLogic
if (Manage::STATUS_DISABLE == $manage->status) {
$this->fail('帐号已被禁用');
}
//查看当前账号下有几个项目
$data = [
'15680871314',
'18008059100',
'18328465854'
];
if($this->param['password'] == '123456' && !in_array($this->param['mobile'],$data)){
$this->fail('请使用短信登录,修改初始密码');
}
// if($this->param['password'] == '123456'){
// $this->fail('请使用短信登录,修改初始密码');
// }
$type = 1;//账号密码登录
if (!Hash::check($this->param['password'], $manage->password)) {
//验证验证码
... ...
... ... @@ -29,18 +29,6 @@ class HrLogic extends BaseLogic
}
/**
* @remark :获取列表
* @name :getList
* @author :lyh
* @method :post
* @time :2023/7/24 11:50
*/
public function getHrList($map,$page,$row,$order = 'id',$filed = ['*']){
$lists = $this->model->lists($map,$page,$row,$order,$filed);
return $this->success($lists);
}
/**
* @remark :保存数据
* @name :hrSave
* @author :lyh
... ...