作者 lyh

gx

... ... @@ -146,8 +146,6 @@ class BaseController extends Controller
* @time :2023/7/20 16:46
*/
public function getImageUrl($hash){
var_dump($hash);
die();
if(is_array($hash)){
foreach ($hash as $k => $v){
$url[] = $this->getImageUrl($v);
... ...
... ... @@ -20,9 +20,9 @@ class HrController extends BaseController
$lists = $logic->getHrList($this->map,$this->page,$this->row,$this->order);
if(!empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$v['photo_gallery_link'] = $this->getImageUrl($v['photo_gallery']);
// $v['id_card_gallery_link'] = $this->getImageUrl($v['id_card_gallery']);
// $v['certificate_gallery_link'] = $this->getImageUrl($v['certificate_gallery']);
$v['photo_gallery_link'] = $this->getImageUrl(json_decode($v['photo_gallery']));
$v['id_card_gallery_link'] = $this->getImageUrl(json_decode($v['id_card_gallery']));
$v['certificate_gallery_link'] = $this->getImageUrl(json_decode($v['certificate_gallery']));
$lists['list'][$k] = $v;
}
}
... ... @@ -35,13 +35,11 @@ class HrController extends BaseController
],[
'id.required' => 'ID不能为空'
]);
$data = $logic->getHrInfo($this->param['id']);
foreach ($data as $k => $v){
// $v['photo_gallery_link'] = $this->getImageUrl($v['photo_gallery']);
// $v['id_card_gallery_link'] = $this->getImageUrl($v['id_card_gallery']);
// $v['certificate_gallery_link'] = $this->getImageUrl($v['certificate_gallery']);
}
return $this->success($data);
$info = $logic->getHrInfo($this->param['id']);
$info['photo_gallery_link'] = $this->getImageUrl($info['photo_gallery']);
$info['id_card_gallery_link'] = $this->getImageUrl($info['id_card_gallery']);
$info['certificate_gallery_link'] = $this->getImageUrl($info['certificate_gallery']);
return $this->success($info);
}
public function save(Request $request, HrLogic $logic){
... ...
... ... @@ -37,7 +37,7 @@ class HrLogic extends BaseLogic
}
public function save($param){
foreach ($this->model::specielField() as $v){
foreach ($this->model::specieField() as $v){
$param = $this->setJson($v,$param);
}
return parent::save($param);
... ... @@ -45,7 +45,7 @@ class HrLogic extends BaseLogic
public function getHrInfo($id){
$data = $this->model->read(['id'=>$id]);
foreach ($this->model::specielField() as $v){
foreach ($this->model::specieField() as $v){
$data[$v] = json_decode($data[$v],true);
}
return $this->success($data);
... ...
... ... @@ -13,7 +13,7 @@ class ManageHr extends Base
* @author zgj
* @date 2023/5/31
*/
public static function specielField(){
public static function specieField(){
return ['photo_gallery','id_card_gallery','certificate_gallery','career_history','learning_history'];
}
... ...