作者 lyh

gx

@@ -17,10 +17,10 @@ class HrController extends BaseController @@ -17,10 +17,10 @@ class HrController extends BaseController
17 * @method :post 17 * @method :post
18 * @time :2023/7/24 11:56 18 * @time :2023/7/24 11:56
19 */ 19 */
20 - public function list(HrLogic $logic) 20 + public function list(ManageHr $manageHr)
21 { 21 {
22 - $lists = $logic->getHrList($this->map,$this->page,$this->row,$this->order);  
23 - if(!empty($lists['list'])){ 22 + $lists = $manageHr->lists($this->map,$this->page,$this->row,$this->order);
  23 + if(!empty($lists) && !empty($lists['list'])){
24 foreach ($lists['list'] as $k => $v){ 24 foreach ($lists['list'] as $k => $v){
25 $v['photo_gallery_link'] = json_decode($v['photo_gallery']); 25 $v['photo_gallery_link'] = json_decode($v['photo_gallery']);
26 $v['id_card_gallery_link'] = json_decode($v['id_card_gallery']); 26 $v['id_card_gallery_link'] = json_decode($v['id_card_gallery']);
@@ -166,10 +166,7 @@ class ImageController extends Controller @@ -166,10 +166,7 @@ class ImageController extends Controller
166 if ($type == 'multi') { 166 if ($type == 'multi') {
167 return $this->multi($files); 167 return $this->multi($files);
168 }else{ 168 }else{
169 - $size = $files->getSize();  
170 - $image_type = $files->getClientOriginalExtension();  
171 - $mime = $files->getMimeType();  
172 - return $this->single($files,$size,$image_type,$mime); 169 + return $this->single($files);
173 } 170 }
174 } 171 }
175 172
@@ -181,14 +178,23 @@ class ImageController extends Controller @@ -181,14 +178,23 @@ class ImageController extends Controller
181 * @method :post 178 * @method :post
182 * @time :2023/6/17 16:30 179 * @time :2023/6/17 16:30
183 */ 180 */
184 - public function single(&$files,$size,$image_type,$mime){ 181 + public function single(&$files){
  182 + $size = $files->getSize();
  183 + $image_type = $files->getClientOriginalExtension();
  184 + $mime = $files->getMimeType();
185 $hash = hash_file('md5', $files->getPathname()); 185 $hash = hash_file('md5', $files->getPathname());
186 //查看文件是否存在 186 //查看文件是否存在
187 $imageModel = new ImageModel(); 187 $imageModel = new ImageModel();
188 - $image_hash = $imageModel->read(['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0]); 188 + //查看图片是否已上传
  189 + $param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0];
  190 + if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
  191 + $param['project_id'] = $this->cache['project_id'];
  192 + }
  193 + $image_hash = $imageModel->read($param);
189 if($image_hash !== false){ 194 if($image_hash !== false){
190 return $this->response('图片资源',Code::SUCCESS,$this->responseData($image_hash['path'])); 195 return $this->response('图片资源',Code::SUCCESS,$this->responseData($image_hash['path']));
191 } 196 }
  197 + //保存路径
192 $url = $this->config['root'].$this->path; 198 $url = $this->config['root'].$this->path;
193 $fileName = uniqid().rand(10000,99999).'.'.$image_type; 199 $fileName = uniqid().rand(10000,99999).'.'.$image_type;
194 //上传到cos 200 //上传到cos
@@ -196,10 +202,7 @@ class ImageController extends Controller @@ -196,10 +202,7 @@ class ImageController extends Controller
196 $cosService = new CosService(); 202 $cosService = new CosService();
197 $cosService->uploadFile($files,$this->path,$fileName); 203 $cosService->uploadFile($files,$this->path,$fileName);
198 }else{ 204 }else{
199 - $res = $files->move($url,$fileName);  
200 - if ($res === false) {  
201 - return $this->response($files->getError(), Code::USER_ERROR);  
202 - } 205 + $files->move($url,$fileName);
203 } 206 }
204 $this->saveMysql($imageModel,$size,$image_type,$fileName,$hash,$this->upload_location,$mime); 207 $this->saveMysql($imageModel,$size,$image_type,$fileName,$hash,$this->upload_location,$mime);
205 return $this->response('图片资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName)); 208 return $this->response('图片资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName));
@@ -230,10 +233,8 @@ class ImageController extends Controller @@ -230,10 +233,8 @@ class ImageController extends Controller
230 } 233 }
231 return true; 234 return true;
232 } 235 }
  236 +
233 /** 237 /**
234 - * @param $info  
235 - * @param $w  
236 - * @param $h  
237 * @remark :生成缩略图 238 * @remark :生成缩略图
238 * @name :cacheImage 239 * @name :cacheImage
239 * @author :lyh 240 * @author :lyh
@@ -248,7 +249,6 @@ class ImageController extends Controller @@ -248,7 +249,6 @@ class ImageController extends Controller
248 } 249 }
249 250
250 /** 251 /**
251 - * @param $files  
252 * @remark :多图片上传 252 * @remark :多图片上传
253 * @name :multi 253 * @name :multi
254 * @author :lyh 254 * @author :lyh
@@ -263,7 +263,12 @@ class ImageController extends Controller @@ -263,7 +263,12 @@ class ImageController extends Controller
263 $mime = $file->getMimeType(); 263 $mime = $file->getMimeType();
264 $imageModel = new ImageModel(); 264 $imageModel = new ImageModel();
265 $hash = hash_file('md5', $file->getPathname()); 265 $hash = hash_file('md5', $file->getPathname());
266 - $image_hash = $imageModel->read(['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0]); 266 + //查看图片是否已上传
  267 + $param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0];
  268 + if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
  269 + $param['project_id'] = $this->cache['project_id'];
  270 + }
  271 + $image_hash = $imageModel->read($param);
267 if($image_hash !== false){ 272 if($image_hash !== false){
268 $data[] = $this->responseData($image_hash['path']); 273 $data[] = $this->responseData($image_hash['path']);
269 continue; 274 continue;
@@ -275,10 +280,7 @@ class ImageController extends Controller @@ -275,10 +280,7 @@ class ImageController extends Controller
275 $cosService = new CosService(); 280 $cosService = new CosService();
276 $cosService->uploadFile($file,$this->path,$fileName); 281 $cosService->uploadFile($file,$this->path,$fileName);
277 }else{ 282 }else{
278 - $res = $file->move($url,$fileName);  
279 - if ($res === false) {  
280 - $this->response($file->getError(), Code::USER_ERROR);  
281 - } 283 + $file->move($url,$fileName);
282 } 284 }
283 //批量存储 285 //批量存储
284 $this->saveMysql($imageModel,$size,$image_type,$fileName,$hash,$this->upload_location,$mime); 286 $this->saveMysql($imageModel,$size,$image_type,$fileName,$hash,$this->upload_location,$mime);
@@ -46,15 +46,9 @@ class LoginLogic extends BaseLogic @@ -46,15 +46,9 @@ class LoginLogic extends BaseLogic
46 if (Manage::STATUS_DISABLE == $manage->status) { 46 if (Manage::STATUS_DISABLE == $manage->status) {
47 $this->fail('帐号已被禁用'); 47 $this->fail('帐号已被禁用');
48 } 48 }
49 - //查看当前账号下有几个项目  
50 - $data = [  
51 - '15680871314',  
52 - '18008059100',  
53 - '18328465854'  
54 - ];  
55 - if($this->param['password'] == '123456' && !in_array($this->param['mobile'],$data)){  
56 - $this->fail('请使用短信登录,修改初始密码');  
57 - } 49 +// if($this->param['password'] == '123456'){
  50 +// $this->fail('请使用短信登录,修改初始密码');
  51 +// }
58 $type = 1;//账号密码登录 52 $type = 1;//账号密码登录
59 if (!Hash::check($this->param['password'], $manage->password)) { 53 if (!Hash::check($this->param['password'], $manage->password)) {
60 //验证验证码 54 //验证验证码
@@ -29,18 +29,6 @@ class HrLogic extends BaseLogic @@ -29,18 +29,6 @@ class HrLogic extends BaseLogic
29 } 29 }
30 30
31 /** 31 /**
32 - * @remark :获取列表  
33 - * @name :getList  
34 - * @author :lyh  
35 - * @method :post  
36 - * @time :2023/7/24 11:50  
37 - */  
38 - public function getHrList($map,$page,$row,$order = 'id',$filed = ['*']){  
39 - $lists = $this->model->lists($map,$page,$row,$order,$filed);  
40 - return $this->success($lists);  
41 - }  
42 -  
43 - /**  
44 * @remark :保存数据 32 * @remark :保存数据
45 * @name :hrSave 33 * @name :hrSave
46 * @author :lyh 34 * @author :lyh