作者 lyh

gx

@@ -146,8 +146,6 @@ class BaseController extends Controller @@ -146,8 +146,6 @@ class BaseController extends Controller
146 * @time :2023/7/20 16:46 146 * @time :2023/7/20 16:46
147 */ 147 */
148 public function getImageUrl($hash){ 148 public function getImageUrl($hash){
149 - var_dump($hash);  
150 - die();  
151 if(is_array($hash)){ 149 if(is_array($hash)){
152 foreach ($hash as $k => $v){ 150 foreach ($hash as $k => $v){
153 $url[] = $this->getImageUrl($v); 151 $url[] = $this->getImageUrl($v);
@@ -20,9 +20,9 @@ class HrController extends BaseController @@ -20,9 +20,9 @@ class HrController extends BaseController
20 $lists = $logic->getHrList($this->map,$this->page,$this->row,$this->order); 20 $lists = $logic->getHrList($this->map,$this->page,$this->row,$this->order);
21 if(!empty($lists['list'])){ 21 if(!empty($lists['list'])){
22 foreach ($lists['list'] as $k => $v){ 22 foreach ($lists['list'] as $k => $v){
23 - $v['photo_gallery_link'] = $this->getImageUrl($v['photo_gallery']);  
24 -// $v['id_card_gallery_link'] = $this->getImageUrl($v['id_card_gallery']);  
25 -// $v['certificate_gallery_link'] = $this->getImageUrl($v['certificate_gallery']); 23 + $v['photo_gallery_link'] = $this->getImageUrl(json_decode($v['photo_gallery']));
  24 + $v['id_card_gallery_link'] = $this->getImageUrl(json_decode($v['id_card_gallery']));
  25 + $v['certificate_gallery_link'] = $this->getImageUrl(json_decode($v['certificate_gallery']));
26 $lists['list'][$k] = $v; 26 $lists['list'][$k] = $v;
27 } 27 }
28 } 28 }
@@ -35,13 +35,11 @@ class HrController extends BaseController @@ -35,13 +35,11 @@ class HrController extends BaseController
35 ],[ 35 ],[
36 'id.required' => 'ID不能为空' 36 'id.required' => 'ID不能为空'
37 ]); 37 ]);
38 - $data = $logic->getHrInfo($this->param['id']);  
39 - foreach ($data as $k => $v){  
40 - // $v['photo_gallery_link'] = $this->getImageUrl($v['photo_gallery']);  
41 -// $v['id_card_gallery_link'] = $this->getImageUrl($v['id_card_gallery']);  
42 -// $v['certificate_gallery_link'] = $this->getImageUrl($v['certificate_gallery']);  
43 - }  
44 - return $this->success($data); 38 + $info = $logic->getHrInfo($this->param['id']);
  39 + $info['photo_gallery_link'] = $this->getImageUrl($info['photo_gallery']);
  40 + $info['id_card_gallery_link'] = $this->getImageUrl($info['id_card_gallery']);
  41 + $info['certificate_gallery_link'] = $this->getImageUrl($info['certificate_gallery']);
  42 + return $this->success($info);
45 } 43 }
46 44
47 public function save(Request $request, HrLogic $logic){ 45 public function save(Request $request, HrLogic $logic){
@@ -37,7 +37,7 @@ class HrLogic extends BaseLogic @@ -37,7 +37,7 @@ class HrLogic extends BaseLogic
37 } 37 }
38 38
39 public function save($param){ 39 public function save($param){
40 - foreach ($this->model::specielField() as $v){ 40 + foreach ($this->model::specieField() as $v){
41 $param = $this->setJson($v,$param); 41 $param = $this->setJson($v,$param);
42 } 42 }
43 return parent::save($param); 43 return parent::save($param);
@@ -45,7 +45,7 @@ class HrLogic extends BaseLogic @@ -45,7 +45,7 @@ class HrLogic extends BaseLogic
45 45
46 public function getHrInfo($id){ 46 public function getHrInfo($id){
47 $data = $this->model->read(['id'=>$id]); 47 $data = $this->model->read(['id'=>$id]);
48 - foreach ($this->model::specielField() as $v){ 48 + foreach ($this->model::specieField() as $v){
49 $data[$v] = json_decode($data[$v],true); 49 $data[$v] = json_decode($data[$v],true);
50 } 50 }
51 return $this->success($data); 51 return $this->success($data);
@@ -13,7 +13,7 @@ class ManageHr extends Base @@ -13,7 +13,7 @@ class ManageHr extends Base
13 * @author zgj 13 * @author zgj
14 * @date 2023/5/31 14 * @date 2023/5/31
15 */ 15 */
16 - public static function specielField(){ 16 + public static function specieField(){
17 return ['photo_gallery','id_card_gallery','certificate_gallery','career_history','learning_history']; 17 return ['photo_gallery','id_card_gallery','certificate_gallery','career_history','learning_history'];
18 } 18 }
19 19